开发者

Passing JSP parameter to javascript won't work in IE8!

开发者 https://www.devze.com 2022-12-31 01:53 出处:网络
I\'ve got a Servlet that generates a XML string (relatively long) w开发者_JS百科hich I then pass to a Javascript variable in the forwarded JSP file:

I've got a Servlet that generates a XML string (relatively long) w开发者_JS百科hich I then pass to a Javascript variable in the forwarded JSP file:

$(document).ready(function() {
    ...
    var itXML = <% out.print((String) request.getAttribute("xml")); %>;
    ...
}

This seems to work just fine in Firefox, but when I run the same project on IE8 I get a syntax error for this line.

Any Ideas?


Internet Explorer doesn't support E4X, use JSON instead of XML.

0

精彩评论

暂无评论...
验证码 换一张
取 消