working in Netsc6 and ie 6 but not in Opera7.21

Q

Québec

Hi,
I am new to Opera and I am quite surprised. I opened the javascript console:
nothing.
Nothing appears except the bargroung image in opera.


<SCRIPT LANGUAGE="JavaScript">
var input = getCookieData("webJPD");
var hello = input.substring(0, input.indexOf("|"))
var lang = input.substring( input.indexOf("|") + 1, input.length)

if(input){
if(lang == "francais"){
document.write("<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>Heureux de
vous
revoir</p><p></p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;" + hello + "</p>");
setTimeout('location.replace("paintings5.htm");', 5000)
}

if(lang == "english"){
document.write("<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>Good to see
you
again</p><p></p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&
nbsp;&nbsp;" + hello + "</p>");
setTimeout('location.replace("paintings5.htm");', 5000)
}
}else{
var texte = '<form name="R"><p>First name:<input type="text" name="T1"
size="20"></p>'
texte += '<p>Français:<input type="radio" value="V1" name="R1"
onClick="setCookie(document.R.T1.value, \'francais\')"></p>'
texte += '<p>English:<input type="radio" value="V2" name="R1"
onClick="setCookie(document.R.T1.value, \'english\')"></p></form>'
texte += '<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>Veuillez indiquer
votre préférence SVP.</p>'
texte += '<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>Please check for
your prefered language.</p>'
texte += '<p>&nbsp;</p><p>Merci - Thank you</p>'
texte += '<p>&nbsp;</p><p></p>'
document.writeln(texte);
}
</script>
 
L

Lasse Reichstein Nielsen

Québec said:
I am new to Opera and I am quite surprised. I opened the javascript console:
nothing.
Nothing appears except the bargroung image in opera.

Then there is probably some error in the logic, not in the code.
<SCRIPT LANGUAGE="JavaScript">
var input = getCookieData("webJPD");

insert:
alert([input,typeof input,!!input]);
and see what it gives.
If input=="", then the result is
,string,false
That would indeed make nothing happen because of the if(input),
but it would still work for the substring operations. If it gives
some other result, but still with "false" at the end, then that
is why nothing is written.

Notice that Opera is strict in requireing, e g., correct dates on
cookies. Your cookie might have been refused because it is invalid. IE
is much more forgiving (some would say too much). I don't know about
Mozilla.

/L
 
Q

Québec

Lasse Reichstein Nielsen said:
Québec said:
I am new to Opera and I am quite surprised. I opened the javascript console:
nothing.
Nothing appears except the bargroung image in opera.

Then there is probably some error in the logic, not in the code.
<SCRIPT LANGUAGE="JavaScript">
var input = getCookieData("webJPD");

insert:
alert([input,typeof input,!!input]);
and see what it gives.
If input=="", then the result is
,string,false
That would indeed make nothing happen because of the if(input),
but it would still work for the substring operations. If it gives
some other result, but still with "false" at the end, then that
is why nothing is written.

Notice that Opera is strict in requireing, e g., correct dates on
cookies. Your cookie might have been refused because it is invalid. IE
is much more forgiving (some would say too much). I don't know about
Mozilla.


I took off all the ifs

Inline script thread
Error:
name: ReferenceError
message: Statement on line 2: Reference to undefined variable: No such
variable 'getCookieData'
Backtrace:
Line 2 of inline#1 script in file://localhost/C:/Documents and
Settings/Jean Pierre/Desktop/testOpera.html
var input = getCookieData("webJPD");
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top