> Posted by: "J.C. Berry" jcharlesberry@gmail.com jcharlesberry
> Date: Fri May 15, 2009 9:30 am ((PDT))
>
> Hello, was looking at a tutorial on AJAX here -
> http://www.htmlgoodies.com/beyond/javascript/article.php/3702926 - and I
> didn't understand something that I am apparently not aware of: why are there
> no tags around the JS and where is the "javascript" CSS class? Are these
> connected in some way (doubtful, but just in case I was not aware of
> something arcane)? I have not seen code without script tags surrounding the
> code. Can you point me to a short tutorial or reference about this?
> A sample of what they do in the article:
>
> <div style="width: 700px;">
> <textarea name="code" class="javascript" cols="60" rows="10">
> var Ajax = new Object();
> Ajax.isUpdating = true;
Simple explanation: they screwed up. :)
Looks like they included and escaped the <div> and <textarea> tags
intended to display the example JS code.
Note that the second and later code listings are intended to be included
in separate .js files (e.g. "...we can create the JavaScript files that
we are including. The first file is...").
<script> is a HTML tag. It is used in HTML markup (and nowhere else) to
include script code in the page. It can do this in one of two ways:
1. as the content of the tag
2. from a separate file (using <script src="...">)
A .js file should contain nothing but JavaScript code. <script> tags are
not scripting code. I would expect using <script> in a .js or other
script file to cause errors, and would consider it a bug if it did not.
I suggest you contact the site's owners and ask them to correct the errors.
cheers
jon.
--
This message has not been scanned for viruses.
Since I do not use a Microsoft operating
system or software, and use only plaintext
for email, there is little need for me to do so.
------------------------------------
Visit http://aiaiai.com for more groups to joinYahoo! Groups Links
<*> To reply to this message, go to:
http://groups.yahoo.com/group/JavaScript_Official/post?act=reply&messageNum=16676
Please do not reply to this message via email. More information here:
http://help.yahoo.com/help/us/groups/messages/messages-23.html
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/JavaScript_Official/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:JavaScript_Official-digest@yahoogroups.com
mailto:JavaScript_Official-fullfeatured@yahoogroups.com
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/JavaScript_Official/
<*> To unsubscribe from this group, send an email to:
JavaScript_Official-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
0 comments:
Post a Comment