Closed Avec112 closed 11 years ago
Nope. Seems script(src='/js/jquery.js')
do not work either. Same messed up DOM.
How can this be?
You need to use view page source
, not the dom inspector. I've tested this out and:
script(src='http://code.jquery.com/jquery.js')
<script src="http://code.jquery.com/jquery.js"></script>
Hmmm. Strange. I did not mention in but I used Chrome (developer tools DOM inspector). View page source showed the DOM correctly but it do not explain why the DOM inspector shows something else.
In firebug it looks ok by the way.
So where is the bug, in Chrome developer tools?
That's not a "bug", just a hook for you.
Nami-Doc I do not understand.
If Chrome Developer Tools and Firebug shows two different DOMs would it not be natural to think there is a bug somewhere?
When I include a script tag a sure do not expect at style tag apear under the script tag. And <body style>
whats that about?
That's to allow you to add styling easily. Like the $
defined in chrome's RE
PL, that's just to ease the developers.
(sorry, can't edit from my phone)
script(src='http://code.jquery.com/jquery.js')
- FAIL (URL is valid)script(src='http://code.jquery.com/whatever/jquery.js')
- OKscript(src='http://code.jquery.com/whatever.js')
- OKscript(src='http://whatever.jquery.com/jquery.js')
- OKscript(src='http://code.whatever.com/jquery.js')
- OKscript(src='http://code.jquery.whatever/jquery.js')
- OKscript(src='http://backbonejs.org/backbone-min.js')
-OK (URL is valid)I thought that maybe only valid url's failed but the last line proved that not to be the case. Somehow the url cannot be
http://code.jquery.com/jquery.js
. Everything else seem to work just fine.The first URL reference messes up the DOM to something like this
I can get around the problem by having the the jquery.js referenced from a local directory.
script(src='/whatever/jquery.js')
- OK