Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 28th, 2007, 01:06 AM
Registered User
 
Join Date: Aug 2007
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");}
 
Old August 28th, 2007, 08:14 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
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
 
Old August 29th, 2007, 04:52 AM
Registered User
 
Join Date: Aug 2007
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


 
Old August 29th, 2007, 11:59 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
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
 
Old August 29th, 2007, 12:00 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
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
 
Old August 30th, 2007, 01:33 AM
Registered User
 
Join Date: Aug 2007
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


 
Old August 31st, 2007, 03:37 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
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
 
Old August 31st, 2007, 08:14 PM
jminatel's Avatar
Wrox Staff
Points: 18,059, Level: 58
Points: 18,059, Level: 58 Points: 18,059, Level: 58 Points: 18,059, Level: 58
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2003
Posts: 1,906
Thanks: 62
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/





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.