Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Explorer Problem with a routine

Status
Not open for further replies.

coerrace

Vendor
Jun 22, 2007
3
MX
I have a routine and i can´t open with internet explorer with opera works fine perfect but with explorer in the call i put on red at the bottom of the routine. I dont know how to fix the routine or what to modify to run on internet explorer. Thank you the routine is:

function showResults(last_search_data,actname){
last_search_data = unescape(lessondetails[last_search_data])
floater=window.open('', '', 'toolbar=yes,location=no,resizable=yes,directories=no,menubar=yes,scrollbars=yes')
floater.document.open()
floater.document.write ('<HTML><HEAD><TITLE>Report</TITLE></HEAD>')
floater.document.write ("<link rel='stylesheet' href='../styles/kplmsstyle.css'>")
floater.document.write ('<body bgcolor="#FFFFFF">')
floater.document.write ('<P class=r_detailed><B>Detailed Report Summary</B></P>')
floater.document.write ('<P class=r_activity><B>Lesson:</B> ' + actname + '</P>')
floater.document.write ('<P class=r_username><B>Results Summary for</B> ' + scorm_student_name + '</P>')
splitdetails2 = last_search_data.split("¦")
floater.document.write ('<P class=r_date><B>Date Taken:</B> ' + splitdetails2[3] + '</P>')
floater.document.write ('<P class=r_status><B>Status:</B> ' + splitdetails2[2] + '</P>')
floater.document.write ('<P class=r_score><B>Score:</B> ')
if (splitdetails2[6]=="0"){
floater.document.write ('Not applicable</P>')
floater.document.write ('<!-- saved from url=(0014)about:internet -->')
}else{
floater.document.write (parseInt(splitdetails2[4]) + '%</P>')
floater.document.write ('<!-- saved from url=(0014)about:internet -->')
}
floater.document.write ('<P class=r_time><B>Time Taken:</B> ' + splitdetails2[1] + ' (HHHH:MM:SS)</P>')
if (typeof splitdetails[7]!='undefined'){
splitdetails2[7]=fur(splitdetails2[7],'¥¥¥','®®®')
splitdetails2[7]=fur(splitdetails2[7],'¥¥','®®®')
splitdetails2[7]=fur(splitdetails2[7],'®®®','¥¥¥')
floater.document.write ('<P class=r_detailed><B>Detailed Results</B></P>')
splitdetails3 = splitdetails2[7].split("¥¥¥")
for (j = 0; j <= splitdetails3.length-2; j++) {
splitdetails4 = splitdetails3[j].split("¥")
if (splitdetails4[1]=='choice'){
floater.document.write ('<P class=r_question><B>Question:</B> ' + fur(splitdetails4[2],'_',' ') + '</P>')
floater.document.write ('<P class=r_answer><B>Answer Selected:</B> ' + splitdetails4[7] + '</P>')
floater.document.write ('<P class=r_result><B>Result:</B> ' + splitdetails4[3] + '</P>')
if (splitdetails4[3]=='wrong'){
floater.document.write ('<P class=r_correct><B>Correct Result:</B> ' + splitdetails4[8] + '</P>')
}
floater.document.write ('<P class=r_ttaken><B>Time Taken to Answer:</B> ' + splitdetails4[5] + ' (HHHH:MM:SS)</P>')
}else{
if (splitdetails4[1]=='newperformance'){
floater.document.write ('<P class=r_question><B>Objective:</B> ' + fur(splitdetails4[2],'_',' ') + '</P>')
if (splitdetails4[7]!=' '){floater.document.write ('<P class=r_answer><B>Answer Selected:</B> ' + splitdetails4[7] + '</P>')}
floater.document.write ('<P class=r_result><B>Result:</B> ' + parseInt(splitdetails4[3]) + '%</P>')
if (parseInt(splitdetails4[3])==0&&splitdetails4[8]!=' '){
floater.document.write ('<P class=r_correct><B>Correct Result:</B> ' + splitdetails4[8] + '</P>')
}
floater.document.write ('<P class=r_ttaken><B>Time Taken to Complete Objective:</B> ' + splitdetails4[5] + ' (HHHH:MM:SS)</P>')
}else{
floater.document.write ('<P class=r_question><B>Objective:</B> ' + splitdetails4[2] + '</P>')
floater.document.write ('<P class=r_result><B>Result:</B> ' + parseInt(splitdetails4[3]) + '%</P>')
floater.document.write ('<P class=r_ttaken><B>Time Taken to Complete Objective:</B> ' + splitdetails4[5] + ' (HHHH:MM:SS)</P>')
}
}
}
}
floater.document.write ('</body>')
floater.document.write ('</html>')
floater.document.close()
floater.focus()
}

and look the call where not launch:

msg = msg + "<TD><P class=attempted><B><A HREF='javascript:showResults(\"" + sendstring + "\",\"" + actname + "\")'>Show Details</B></A></P></TD></TR>"
 
Note that script run perfect on a any explorer or mozilla form any server or with 127.0.0.1 but this application will run on CD only is not for a server is for that i need to solve. Thank you
 
I don't know if I'm elitist or what...... but every time I look at a big mess of unindented code I don't even want to waste my time trying to figure it out.....

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
 
Hi

Just as kaht wrote... :-(

Let us start with
[ul]
[li]post your code between [tt][ignore]
Code:
[/ignore][/tt] and [tt][ignore]
[/ignore][/tt] tags[/li]
[li]indent your code[/li]
[li]change your code in the below faster and more readable way[/li]
[/ul]
Code:
[red]str =[/red]'<HTML><HEAD><TITLE>Report</TITLE></HEAD>'
[red]str+=[/red]"<link rel='stylesheet' href='../styles/kplmsstyle.css'>"
[red]str+=[/red]'<body bgcolor="#FFFFFF">'
[gray]// ...[/gray]
[red]str+=[/red]'</body>'
[red]str+=[/red]'</html>'

floater.document.open()
floater.document.write([red]str[/red])
floater.document.close()

Feherke.
 
ok look guys the code i only put the most important this is a simply function on java and later call with javascript command that´s all:

function showResults(last_search_data,actname){
last_search_data = unescape(lessondetails[last_search_data])
floater=window.open('', '', 'toolbar=yes,location=no,resizable=yes,directories=no,menubar=yes,scrollbars=yes')
floater.document.open()


Then the rest of the Html write

floater.document.write ('<HTML><HEAD><TITLE>Report</TITLE></HEAD>')
floater.document.write ("<link rel='stylesheet' href='../styles/kplmsstyle.css'>")
floater.document.write ('<body bgcolor="#FFFFFF">')

Here will be the rest of the code dont need to put is only writes and youhave at the top.

Then the close of the document and fucntion:

floater.document.close()
floater.focus()
}


Then the call this call i have inside a variable called msg and execute later:

msg = msg + "<TD><P class=attempted><B><A HREF='javascript:showResults(\"" + sendstring + "\",\"" + actname + "\")'>Show Details</B></A></P></TD></TR>"

I execute the msg to write and view the results on the page with:

document.write (msg)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top