473,325 Members | 2,480 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

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

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;&nb sp;&nbsp;&n
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&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;&nb sp;&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>
Jul 20 '05 #1
3 1297
"Québec" <jp**@vidn.ca> writes:
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
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

"Lasse Reichstein Nielsen" <lr*@hotpop.com> wrote in message
news:d6**********@hotpop.com...
"Québec" <jp**@vidn.ca> writes:
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");
Jul 20 '05 #3
I get it.

FPage has added a head and body tag.
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Mullin Yu | last post by:
hi, i have a web service that has file operations on Windows OS, and there may be a file concurrency issue if only one working directory e.g. c:\working therefore, i want to have a unique sub...
5
by: Martin Heuckeroth | last post by:
Hi We are working on a webservice application and are having some problems with the cookies and/or sessions. We have them working on our intranet but then its not working on the internet. We...
5
by: tshad | last post by:
I have been working with setting my drop boxes to allow double clicking to select an item. It worked fine until I made some changes. I then stripped the page down to the bare essentials to find...
8
by: jojobar | last post by:
Okay, I am trying to do is to test the webresource in 2.0 1. I created a new project with assembly name (and default assembly name) "Office". 2. I added the following to the AssemblyInfo.cs...
2
by: Don | last post by:
I'm having problems with intellisense, autocomplete, etc. suddenly not working in certain classes of a project I'm working on. All the options are set, and it all works fine for most classes, but...
9
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. ...
4
by: qbproger | last post by:
I'm developing a plugin for some software. The previous version of the software didn't require a start in directory to be set. This allowed me to leave the working directory to the default in the...
3
by: Jason Huang | last post by:
Hi, In our C# Windows Form application, we are using the SQL Server 2000 as the database server. The Database table MyTable has a field RegistrationDate which represents the Date a client comes...
0
by: WORKING IN FAITH | last post by:
three years I LOVE You Monica More options 1 message - Collapse all WORKING IN FAITH View profile More options Nov 13, 11:29 am three years I LOVE You Monica
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.