| | |
Little help, please
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Apr 2005
Posts: 149
Reputation:
Solved Threads: 0
•
•
•
•
Thanks, m8. I almost got it working. So, first of all if I put the .js code in the function it doesn't load the script - just keeps loading forever.
So, tooking your suggestion, I'm using this code instead:
... which works, kin of... It loads the script in a new browser window.JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<script language="javascript" type="text/javascript"> function calendar() { document.write("<script language='JavaSc" + "ript' src='http://atat.ro/js/calendar-ortodox.js'></sc" + "ript>") } </script> <input type="submit" onclick="calendar()" value="Calendar Ortodox" name="Calendar" />
Can I make it load under the button, on the same page, I mean? I want the button to show on all pages and the script to load, also, on the site's pages.
BTW, here it is http://atat.ro , upper-right column, just above the social bookmark icons.
Thanks again!
Make a separate file for your java script code and save it with extension ".js" as it will be "filename.js"
Place that js function in that file.
Remember not to use the script tag in that separate js file.
Place the button in your html pages and just make the same function call.
Remember to include the js file in all the pages where u need to use that button and make the same function call.
A js file can be included as:
<script src="filename.js"></script>
I hope it will be helpful to you. All the best
•
•
Join Date: May 2009
Posts: 18
Reputation:
Solved Threads: 0
M8, I don't want to load the javascript when the page loads, that's the point. Your first suggestion was good, only that it loads the script in a new file. I wanted to display, for example, just under the onclick button.
So, short story, that's what I have now:
Q: is there a way to run it on the same page so the script will display the content under the button?
Thanks!
So, short story, that's what I have now:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<input type="submit" onclick="test()" /> <script language="javascript" type="text/javascript"> function test() { document.write("<script language='JavaSc" + "ript' src='http://atat.ro/js/calendar-ortodox.js'></sc" + "ript>") } </script>
Thanks!
![]() |
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: how to read form element values
- Next Thread: whew. i dunno what's wrong with my work
| Thread Tools | Search this Thread |
acid2 ajax ajaxexample ajaxjspservlets array beta box browser captchaformproblem cart checkbox child close codes column css date debugger decimal dependent design disablefirebug dom download editor element embed engine enter error events explorer ext file firefox focus form forms frameworks getselection google gwt gxt hiddenvalue highlightedword hint html ie7 ie8 iframe index internet java javascript javascripthelp2020 jquery jsf jsfile jsp jump libcurl listbox maps masterpage math media menu mp4 object onmouseoutdivproblem onmouseover onreadystatechange parent paypal pdf php position post problem programming prototype redirect runtime safari scale scriptlets scroll search security select shopping size software unicode w3c web window windowofwords wysiwyg \n





