| re: "Error: mozilla is not defined"
In article <5ebd9070.0307242301.5bc70244@posting.google.com >, Peter wrote:[color=blue]
>
> // here comes the line which generates an error.
> // The pages which is build with the buildPage function
> // contains a call to the buildPage function which is executed
> // in the case a user clicks the link "Library".
> // This is to build the page again, but with a different page
> // loaded in the iframe (se below)
> body += "<div class=\"navigation\" id=\"links\"><a href=\"#\"
> onClick=\"buildPage(" + browser + "," + "'default'" + "," +
> "'system/pages/library.html');\">Library</a></div>";[/color]
Ther replaces browser with its value, the string, mozilla, creating
browser(mozilla,....) instead of browser("mozilla",...)[color=blue]
>
> My problem is that when I press the link "Library" I get this error
> from mozillas javascript console:
>
> "Error: mozilla is not defined"
>
> It does find out that the argument "browser" is mozilla (when using
> this browser). Now all it has to do is use this string to collect the
> correct .css-file.[/color]
The problem is that when you wrote the code to the new page,
you wrote the string value of the variable browser, the string
mozilla (if you set browser="mozilla" and then do alert(browser),
it shows the string value, mozilla, not "mozilla"). Add the
double quotes the the new page it is writing. |