简体   繁体   中英

Javascript embedded in html and greater / less than signs

Long time ago I faced a problem with embedding too much JavaScript inside the html page in <script> tags. The JavaScript had lots of < and > signs and it was somehow conflicting with the actual page html tags.

I am now unable to recreate this. How can this possibly happen? Or are the browsers now a bit more intelligent in handling embedded JavasSript?

I just came across this issue, however, not in a browser , but in an IDE - JBoss Developer Studio (which is a variant of Eclipse IDE)

在此处输入图片说明

When i run the application in the browser (its a Java Enterprise application, running on JBoss web server), i get the same error as in the IDE : The content of elements must consist of well-formed character data or markup. While modern browsers have solved this issue, embedding javascript code in a JSF page (Java Server Faces) , as i did, still hits the same problem. Perhaps you might want to give it a try: create a simple JSF application, embed the javascript, run it on a Java web server like JBoss

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM