On Feb 28, 1:50 pm, ASM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:
vunet...@gmail.com a écrit :
I have a function to open new window:
function bla(){ newwin = window.open("page.asp?file=1&id=<%=ID
%>","Image","other params") }
This function works fine mostly, but sometimes, there is a JavaScript
error: "Unterminated string literal".
on which line of your code ?
with what browser ?
Obviously,
this URL comes from another page. And when it comes from the page with>someurl.asp?id=123%0%DA, then my JavaScript throws this error.
what does mean %0%DA ?
isn't it something missing ?
If previous page URL is just someurl.asp?id=123, then JS works
perfect.
However I tried with FF2 directly :
window.open("test.htm?file=1&id=%0%DA");
and ...
works fine
('id' has nonsense, but that works)
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Browsers FF2 and IE7 tested. The same error.
Let's imagine I have a button "Edit Item", which has a hidden value
id=123. The id is taken from the url of this page, say, thispage.asp?
id=123. Form passes this id to anotherpage.asp which gets this id from
the form (with ASP: ID=request("id")) and inserts it into JS like
this:
function bla(){ newwin = window.open("thirdpage.asp?file=1&id=<%= ID
%>" ,"Image", "other params") }
This way it works. But if the same procedure is done starting with
page thispage.asp?id=123%0D%0A, error occurs as described above
"Unterminated string literal" and it even screws the following
functions in JS (they just do not exist).
Maybe I have to unescape url values or smth?