WN

WN (https://www.wn.se/forum/index.php)
-   Off Topic (https://www.wn.se/forum/forumdisplay.php?f=7)
-   -   konstig javscript-syntax? (https://www.wn.se/forum/showthread.php?t=1065907)

naak2803 2015-11-12 16:45

konstig javscript-syntax?
 
Hej,

jag har alltid undrat över varför vissa skriver "<sc'+'ript>" varför inte vara skriva ut "<script>"? Google gör tex.

jayzee 2015-11-12 18:47

Citat:

When a browser's html parser sees the string "</script>", regardless of whether it is in a javascript string or not, it sees it as a closing script tag and ends the current script block. Breaking the "</script>" tag into two pieces prevents this from happening when you need it as a javascript string.
http://stackoverflow.com/questions/2...document-write


Alla tider är GMT +2. Klockan är nu 00:04.

Programvara från: vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Svensk översättning av: Anders Pettersson