html : absurd behaviour
-
Can anyone tell me what is wrong about this silly chunk of code ? var neww; var firstpar; var secondpar; function getfirstpar(){ firstpar=document.getElementById("primo").value; } function getsecondpar() { secondpar=document.getElementById("secondo").value; } function startneww(){ neww = windows.open (“Newpage.htm”, “”, “top=100,left=50”); } First parameter Second parameter I've been working about a week trying to figure out what the hell is wrong , and now I am sick and tired ... why doesn't it work at all ? why do I keep having an error warning on line 14 telling me "invalid character" ? Why do I have an error on line 21 telling "object required" ? and why do other similar web pages work well on the same machine ?
-
Can anyone tell me what is wrong about this silly chunk of code ? var neww; var firstpar; var secondpar; function getfirstpar(){ firstpar=document.getElementById("primo").value; } function getsecondpar() { secondpar=document.getElementById("secondo").value; } function startneww(){ neww = windows.open (“Newpage.htm”, “”, “top=100,left=50”); } First parameter Second parameter I've been working about a week trying to figure out what the hell is wrong , and now I am sick and tired ... why doesn't it work at all ? why do I keep having an error warning on line 14 telling me "invalid character" ? Why do I have an error on line 21 telling "object required" ? and why do other similar web pages work well on the same machine ?
In the "startneww" function and in the text inputs you are using smart quotes instead of the standard single or double quote characters. If you can't see any difference, you should probably use a different text editor. Also, in "startneww" it should be
window.open()
and notwindows.open()
. -
Can anyone tell me what is wrong about this silly chunk of code ? var neww; var firstpar; var secondpar; function getfirstpar(){ firstpar=document.getElementById("primo").value; } function getsecondpar() { secondpar=document.getElementById("secondo").value; } function startneww(){ neww = windows.open (“Newpage.htm”, “”, “top=100,left=50”); } First parameter Second parameter I've been working about a week trying to figure out what the hell is wrong , and now I am sick and tired ... why doesn't it work at all ? why do I keep having an error warning on line 14 telling me "invalid character" ? Why do I have an error on line 21 telling "object required" ? and why do other similar web pages work well on the same machine ?
tiwal wrote:
<input type="button" value="set" önclick="getfirstpar();getsecondpar(); startneww();"/>
You have an umlaut over the
o
character; it should beonclick
. I think maybe your keyboard is generating different characters to the ones you want.Use the best guess
-
In the "startneww" function and in the text inputs you are using smart quotes instead of the standard single or double quote characters. If you can't see any difference, you should probably use a different text editor. Also, in "startneww" it should be
window.open()
and notwindows.open()
. -
In the "startneww" function and in the text inputs you are using smart quotes instead of the standard single or double quote characters. If you can't see any difference, you should probably use a different text editor. Also, in "startneww" it should be
window.open()
and notwindows.open()
. -
tiwal wrote:
<input type="button" value="set" önclick="getfirstpar();getsecondpar(); startneww();"/>
You have an umlaut over the
o
character; it should beonclick
. I think maybe your keyboard is generating different characters to the ones you want.Use the best guess
-
I swear the umlaut wasn't in the original version, it was "o" .. I don't know what to think .... anyway thank you for the support....
-
tiwal wrote:
I swear the umlaut wasn't in the original version
I believe you, as I have seen this happen before, but I cannot recall how or why.
Use the best guess
Probably a spell-checker somewhere along the line as you copy-pasted stuff, automatically fixed it for you. That doesn't really make sense to me because "onclick" is spelled the same way in every language, but it's probably a spell-checker getting in your way.
-
Probably a spell-checker somewhere along the line as you copy-pasted stuff, automatically fixed it for you. That doesn't really make sense to me because "onclick" is spelled the same way in every language, but it's probably a spell-checker getting in your way.
-
That issue has been raised before and IIRC it is done on purpose to fight code injection when inserting HTML. I think Chris is aware of this issue, but I'm not sure if it is on the current agenda. Cheers, Manfred
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
-
That issue has been raised before and IIRC it is done on purpose to fight code injection when inserting HTML. I think Chris is aware of this issue, but I'm not sure if it is on the current agenda. Cheers, Manfred
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
-
As far as I understand the question, this is something the OP created, nothing to do with CodeProject or Chris. Or do you have some extra information about it?
Use the best guess
The umlaut ö gets substituted for the o in onclick when you paste some valid javascript code into the editing text field and then submit your post. So yes this does have something to do with CP. :) It has been reported and discussed before in the Site Bugs and Suggestions forum. Cheers!
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
-
As far as I understand the question, this is something the OP created, nothing to do with CodeProject or Chris. Or do you have some extra information about it?
Use the best guess
I found the link where Chris admitted the bug and said he fixed it. I think one of the hamsters broke loose and undid this www.codeproject.com/Messages/4389900/Re-Whos-the-silly-monkey-that-did-this-onchange-ön.aspx Guess I'll try it out later from my desktop PC and reraise the bug report. Cheers!
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
-
thank you maybe it's like you say but I can't see the difference... I have been using both notepad and Visual Studio ....
Directed quotes and "normal" quotes look a little different, and can look very similar depending on the font you are using and your screen resolution. Directed quotes can get into your code, for example, if you copy some code online and paste it into your code.
These are “directed” quotes.
These are "normal" quotes.See the difference?
-
The umlaut ö gets substituted for the o in onclick when you paste some valid javascript code into the editing text field and then submit your post. So yes this does have something to do with CP. :) It has been reported and discussed before in the Site Bugs and Suggestions forum. Cheers!
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
-
The umlaut ö gets substituted for the o in onclick when you paste some valid javascript code into the editing text field and then submit your post. So yes this does have something to do with CP. :) It has been reported and discussed before in the Site Bugs and Suggestions forum. Cheers!
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
That makes perfect sense, and is probably where I came across it before.
Seo Sligo is the best
-
Can anyone tell me what is wrong about this silly chunk of code ? var neww; var firstpar; var secondpar; function getfirstpar(){ firstpar=document.getElementById("primo").value; } function getsecondpar() { secondpar=document.getElementById("secondo").value; } function startneww(){ neww = windows.open (“Newpage.htm”, “”, “top=100,left=50”); } First parameter Second parameter I've been working about a week trying to figure out what the hell is wrong , and now I am sick and tired ... why doesn't it work at all ? why do I keep having an error warning on line 14 telling me "invalid character" ? Why do I have an error on line 21 telling "object required" ? and why do other similar web pages work well on the same machine ?