Is it possible at all? Is there any way to include a javascript file by typing into the address bar? I am working on a website and my internet's really slow. So lots of time i'll just test my page cliently and then upload the new page. But i found typing "javascript: ***** void 0;" very frustrating. So is there a function or something that let's you to load a js file into the page?
Thanks in advance[/url]
[NOT solved completely]Including js file in address bar
Moderator: General Moderators
[NOT solved completely]Including js file in address bar
Last edited by yoko on Sun Mar 27, 2005 5:54 pm, edited 1 time in total.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
????
Not sure what you mean but I think if you are talking about loading an external JS file then you just mean....
Not sure what you mean but I think if you are talking about loading an external JS file then you just mean....
Code: Select all
<script language="e;javascript"e; type="e;text/javascript"e; src="e;yourfile.js"e;></script>- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Use PHP. Yeah I guess you could technically do some DOM scripting and evaulate what to dynamically create based upon the location object but PHP is far simpler ....
So "yourfile.php?js=functions.js" would output:
Code: Select all
<html>
<head>
<title>Dynamic JS Loader</title>
<?php
$js = $_GET['js'];
if (!empty($js)) {
echo '<script language="javascript" type="text/javascript" src="'.$js.'"></script>';
}
?>
</head>
<body>
....Code: Select all
<html>
<head>
<title>Dynamic JS Loader</title>
<script language="e;javascript"e; type="e;text/javascript"e; src="e;functions.js"e;></script>
</head>
<body>
....