Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 28th, 2007, 01:06 AM
Registered User
 
Join Date: Aug 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem about replacement of already loaded js

Hello,

I want to replace already loaded java script files. So, I find interesting example from Internet that can help me. This example work on IE, but fail on Firefox. Why?

Any idea?

Below are the files from the example.
Greetings!


////test.htm////

<html><head><title>example</title>
<script type="text/javascript" src="test1.js">
</script>
<script type="text/javascript">
function swapJS(thelink)
{
document.getElementsByTagName('script')[0].src=thelink;
// document.getElementsByTagName('script')[0].setAttribute("src", thelink); //this row is the same
}
</script>
</head>
<body>
<a href="#" onmousedown="swapJS('test1.js');alertit()">Load JavaScript file One</a>
<br><br>
<a href="#" onmousedown="swapJS('test2.js');alertit()">Load JavaScript file Two</a>
</body>
</html>



///test1.js///

function alertit() {alert("this is js file one");}



///test2.js///

function alertit() {alert("this is js file two");}
Reply With Quote
  #2 (permalink)  
Old August 28th, 2007, 08:14 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Please move this question to the appropriate Javascript forum category.

Javascript
Javascript How-To

-Peter
Reply With Quote
  #3 (permalink)  
Old August 29th, 2007, 04:52 AM
Registered User
 
Join Date: Aug 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Peter,

I don’t know how to move my question to another forum category.

However, I think that the dynamic change of page (DOM technology) is part of the pure AJAX /and for that is my topic/.

Regards


Reply With Quote
  #4 (permalink)  
Old August 29th, 2007, 11:59 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

AJAX generally is intended for client to server interaction. Client-side javascript (whether asynchronous or not) aren't really AJAX in the full sense of the term.

-Peter
Reply With Quote
  #5 (permalink)  
Old August 29th, 2007, 12:00 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I don't have edit rights in this forum category, or I'd move it for you.

You can edit the original post. When it's in edit mode you can select the forum it is in from the drop down box.

-Peter
Reply With Quote
  #6 (permalink)  
Old August 30th, 2007, 01:33 AM
Registered User
 
Join Date: Aug 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, may be you are right about AJAX – I don’t want to dispute.

I have a problem with the browsers, but nothing usefully I don’t see for now in this forum.

I entered in edit mode, but nowhere appears drop dawn menu to change the forum – please check up.

Regards


Reply With Quote
  #7 (permalink)  
Old August 31st, 2007, 03:37 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Ok, possibly it's only a moderator function. But I don't have moderation rights in this category so I can't change it.

-Peter
Reply With Quote
  #8 (permalink)  
Old August 31st, 2007, 08:14 PM
jminatel's Avatar
Wrox Staff
Points: 18,803, Level: 59
Points: 18,803, Level: 59 Points: 18,803, Level: 59 Points: 18,803, Level: 59
Activity: 80%
Activity: 80% Activity: 80% Activity: 80%
 
Join Date: May 2003
Location: Indianapolis, IN, USA.
Posts: 1,943
Thanks: 72
Thanked 139 Times in 101 Posts
Default

I think the move issue is that once a post has a reply only the moderator can move it. maybe. anyway, I'm moving it now.

Jim Minatel
Acquisitions Director
Wiley Technology Publishing
WROX Press
Blog: http://wroxblog.typepad.com/
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Zxml.js and input radio problem tezro BOOK: Professional Ajax ISBN: 978-0-471-77778-6 3 December 8th, 2007 05:19 PM
Text Replacement Problem. rupen Classic ASP Basics 4 August 12th, 2005 04:00 AM
Posting problem with forms think JS is the answer? busher Javascript How-To 3 March 4th, 2005 02:06 AM
Problem in printing Document in JS... sweetee JSP Basics 0 May 22nd, 2004 01:10 AM
Replacement beyondforsaken VB How-To 0 June 14th, 2003 10:16 AM



All times are GMT -4. The time now is 05:40 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.