Y
yukatan
I have the following Javascript piece of code in a .js file (it's a function
that generates a new html page with a button to call a function).
var str = "hello";
// some code
with (document) {
// some writes
writeln("<TD><A HREF='javascript:myOwnFunction(str);'><IMG
SRC='images/picture.jpg' BORDER='0'></A></TD></TR>");
}
// some writes
and running it with InternetExplorer6 gives me the error:
--------------------------------
Line: 0
Error: 'str' is not defined
--------------------------------
and Mozilla console says the same.
Seems like it searches the string in a new blank javascript file, but i need
it uses the same file, where my code is.
Any help?
that generates a new html page with a button to call a function).
var str = "hello";
// some code
with (document) {
// some writes
writeln("<TD><A HREF='javascript:myOwnFunction(str);'><IMG
SRC='images/picture.jpg' BORDER='0'></A></TD></TR>");
}
// some writes
and running it with InternetExplorer6 gives me the error:
--------------------------------
Line: 0
Error: 'str' is not defined
--------------------------------
and Mozilla console says the same.
Seems like it searches the string in a new blank javascript file, but i need
it uses the same file, where my code is.
Any help?