[Javascript] Beginner's question

Rick Holcomb rholcomb at holc.biz
Sat Jan 28 13:58:42 CST 2006


When javascript is included from an external file it works as if it were
inside the page you are loading it because it actually is. The script is
linked into the file before processing starts and all functions are then
referenced as if they were included in the html page calling them.

If the shortcut you are talking about contains code like
"javascript:Function("Test");" well the function only exists inside the page
that is calling it and copying the shortcut out and trying to execute it
will not work.

Rick

-----Original Message-----
From: javascript-bounces at LaTech.edu [mailto:javascript-bounces at LaTech.edu]
On Behalf Of Robert Kim Wireless Internet Advisor
Sent: Saturday, January 28, 2006 2:33 PM
To: [JavaScript List]
Subject: Re: [Javascript] Beginner's question

guys... how do you url a javascript that ONLY runs from a page? in
other words... if i click a link.. from a page it works.. but if i
"copy shortcut"
doesnt

On 1/27/06, Jonathan Gold <johnnyclock at gmail.com> wrote:
> My website uses some javascripts. In some cases I call a function that
> is declared in the <head> element. In other cases I simply insert the
> function at the place it comes in the mark-up.
>
> I think my html or xhtml markup would be more readable if I placed the
> javascript functions in a separate file and called them from the xhtml
> file (in the same way that I can offload my style sheet and simply
> refer to it from the webpage).
>
> I imagine there is a simple way to do this.
>
> But I haven't imagined the syntax for such a thing. :~)
>
> Is this a possibility; and how is it accomplished?
>
> Thanks much,
>
>
> --
> Jonathan Gold
> Berkeley, CA
> http://home.pacbell.net/jonnygee/
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
>
>


--
Robert Q Kim, Wireless Internet Advisor
http://evdo-coverage.com/cellular-repeater.html
http://hsdpa-coverage.com

2611 S. Pacific Coast Highway 101
Suite 102
Cardiff by the Sea, CA 92007
206 984 0880
_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript





More information about the Javascript mailing list