Js Works On One Server, Not Another

Jul 23, 2002

I have a basic js that is used to change some images when the user clicks on a link. it worked fine on my server (IIS 4), but when I upload it and the images to another IIS server the images don't display most of the time. I know this is client side -- so why is the server making a difference??

<script language="javascript" type="text/javascript">

var p = new Array(2);
var t = new Array(2);

p[1] = new Image();
p[1].src = "images/8x8_grid.gif";
t[1] = new Image();
t[1].src = "images/grid.gif";

p[2] = new Image();
p[2].src = "images/3x3_hori.gif";
t[2] = new Image();
t[2].src = "images/hori.gif";

function change_image(whichone) {
thumb.src = t[whichone].src;
pattern.src = p[whichone].src;
maintable.background = pattern.src
}

</script>

Here is how I call change_image...

<A href='javascript:void(0);' onmousedown="change_image(&#391;');return false"><img src="images/btn_13x13.gif" width=13 height=13 border=0></A>

View 6 Replies


ADVERTISEMENT

XMLHttpRequest: Script Works To Request XML File On Server But Not On External Server

Oct 2, 2010

I have the following JavaScript (see below). The script requests an XML file from the server and displays it on the page.

The script works fine when the requested XML file is stored on the same server as the script.

The problem is when I try requesting an XML file from an external server such as the National Weather Service. I get an error. If I take the XML file from the National Weather Service and save it to my server it works. Why can't I use my script to request XML files stored on external servers?

Javascript Code

window.onload = initAll;
var xhr = false;
function initAll() {
document.getElementById("makeTextRequest").onclick = getNewFile;

[Code]....

View 8 Replies View Related

JQuery :: Code Works On One Server, Not On The Other?

Apr 27, 2011

I am using a jQuery script to create charts called Highslide. I posted for help on their forum but they are a little slow, and this issue is really regarding a javascript error, I believe.

This issue happensoccasionallyin Internet Explorer 8, where the chart wont appear at all and throws an error. If you refresh the page again, it will display the chart fine. Ive been through this code and can not find what the problem is. what is odd, is if i put the code up on another server it works the first time.

View 1 Replies View Related

Script Works Locally But Not On The Web Server?

Nov 25, 2011

I must make clear that I am not a javascript programmer; I am simply trying to get this script to work on my website. It functions perfectly locally (with all browsers), but after uploading to my website, it shows the controls at the top, but not the content.

Below is the code for the FreeMind Flash Browser which can be found here: [URL]

It requires 2 additional files, flashobject.js and visorFreemind.swf plus the FreeMind file (*.mm) that stores the content. The FreeMind file that has the content displays perfectly on localhost, but not on the website. I have all of these files in the same directory and have double checked everything, but it still doesn't function on my website. I have other flash files and scripts on the same website in other pages that function perfectly.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

[Code]....

View 3 Replies View Related

Menu Works Locally But Not When Uploaded To Server.

Jul 23, 2005

I have created a site with menu, it is working fine locally but when i
upload it on the server it dosen't work. When I click on submenu under
"Company" or "Products",It will show the actual url in the address bar
but it gives a error "405 - resource not allowed". Kindly check and
let me know the solution for this. If you know any other simple script
similar to this let me know.

View 2 Replies View Related

JQuery :: .load Works Locally, Not On Server - Only In IE

May 3, 2011

I've noticed very strange .load behavior. So - I have simple index page like this:

U can check it here: [url]

View 12 Replies View Related

Xml Parser Works Locally For FF But Fails On The Server

Mar 19, 2010

This one has plagued me for some time now. I am parsing an XML file for a search feature. On my local machine, the code below works fine in FF, but when I upload it, I get an error stating y[0] (the root element) is undefined. I think the problem may be with my onload method but I can't be sure.

function importXML()

I just can't figure out why this works locally and not on the server. IE works fine, but then again it uses the activeXObject method so it should function differently.

View 6 Replies View Related

JQuery :: Slideshow Works In Local View But Not On Server

May 30, 2010

Following this jQuery slideshow tutorial (Usecase 3 sample, about 2/3 down the page, this is the one without thumbnails): [url]

I constructed the slideshow:[url]

...which works perfectly in browser view locally (FF and IE). When uploaded to the server, however, I've got a static list of photos as you can see. Can someone shed some light on what the problem is? All relevant files are attached (I changed the images to simple colors to get the file size within the attachment limit).

View 7 Replies View Related

JQuery :: Slideshow Works In Local View But Not On Server?

May 30, 2010

Following this jQuery slideshow tutorial (Usecase 3 sample, about 2/3 down the page, this is the one without thumbnails):

[URL]

I constructed the slideshow:

[URL]

...which works perfectly in browser view locally (FF and IE). When uploaded to the server, however, I've got a static list of photos as you can see. Can someone shed some light on what the problem is? All relevant files are attached (I changed the images to simple colors to get the file size within the attachment limit).

View 2 Replies View Related

JQuery :: AJAX Functionality Works Without Deploying In A HTTP Server?

Jun 29, 2010

I use AJAX functionality in my project & my coding something similar to the following:

$('.home').click(function(event){
event.preventDefault();
$.ajax({
url: 'home.html',

[Code]....

Initially I (successfully) tested my project after deploying to the Apache server which is running in the localhost.

But, if I just open the page in a browser (without deploying to the server), the project works fine! How this is possible?

According to my understanding, if we send an AJAX request, which is really an HTTP request, which has to be received by an HTTP server and the response should come from the server.

View 3 Replies View Related

JQuery :: Works Fine On Localhost But Doesn't Work On External Server?

Jun 23, 2009

I've got jQuery and 2 plugin libraries running on my website. One runs the navigation and the other runs a dropdown search box. Everything works great on my localhost, but when I copied the directory to the external server none of the jQuery worked. I'm not getting any Errors in my error log, and the directory has been copied exactly. [URL]

View 3 Replies View Related

AJAX :: Cross-domain Calls - Loaded From One Server Into A Website On Another Server

Mar 11, 2010

I'm trying to write a script that will be loaded from one server into a website on another server. This script is trying to talk (ajax) to the server that it comes from but I'm getting "Access Denied" errors. I'm well aware that cross-domain calls are not allowed for security reasons so my question is how does Google Analytics work because essentially thats what I'm trying to accomplish. I can embed a Google Analytics script into my website and it'll gather data and send it back to Google.

View 4 Replies View Related

AJAX :: Getting Server Date/time With No Server Side Script

Apr 19, 2010

I'd been looking for some way to get server date/time without using any server side script (such as ASP, PHP, etc).

I found this and it worked just excellent for me! I just want to share it because it wasn't easy to find.

I created a js document with code:

Code:

Now, I can use this js within a html like this:

HTML Code:

You may change your machine date/time and check both dates.

View 1 Replies View Related

Resolve Relative Server Links When HTML Source Is Not On Server

Feb 10, 2010

I would like to open an html file locally (not fetch it from a server) and somehow use javascript to fetch the relative resources from the server. One solution would be to convert all of the relative links to absolute links. I can convert the html source file anyway I wish, but ideally I would like to modify the html source as little as possible, for example insert a function that modifies the result of the src attribute. How would I go about this? Is there any trick I can use to define where the relative home is? Am I going to get into any scripting security gotchas?

View 3 Replies View Related

Saving A File On The Server W/ Js, Ie No Server Code

Dec 31, 2006

I am creating an XML document on my page with javascript. My question
is, is it possible to save that xml file on the server (I have write
permissions) only using javascript, ie no server code? This task would
be trivial using server code, but I was wondering if I can do it all
with client code and post backs? Well, any input?

View 1 Replies View Related

JavaScript Popup On Window Close: Works Great On IE, Works Terribly On FF

Dec 13, 2006

I'm just restating my "site abandonment" post but with a clearer title as I realized it probably only made sense to me and me alone.

I have window that pops up with our commerce system. I have it set to pop up a window via JavaScript if the visitor quits early in the process (abandons the commerce system before completing all of the steps. The new popup is just a customer survey ("why are you leaving, is there something else we can help you with" etc. etc.).

Here's the problem, it works fine in IE, but in Firefox, anytime the page in the original commerce window is changed, refreshed or advanced to a new page, the survey popup window is called rather than just on window close.

Again, here's the two JavaScript routines that handle clicks on the graphical close button and on the window 'X' close button. Code:

View 9 Replies View Related

Server To Server Connection (with Clients)?

Dec 7, 2010

I already have a server connected to clients, clients send msgs and it echoes back to all of them and now i want when a client sends a msg it echoes on his server and the other server too .. so when any of the clients on any of the servers sends a msg it is broadcasted all over the servers to all clients

[Code]...

View 1 Replies View Related

Events - Add Server Control To Custom Webcontrol That Fires Function And A Server Side Function?

Jun 24, 2010

In ASP.Net, I am trying to create a WebControl. In this control, I have RenderControl method overridden with my html controls.

protected override void RenderContents(HtmlTextWriter output)
{
output.Write(@"<table><tr><td>");

[code]....

How can I make the button call the click event so that the server side method btnExecute_Click() can be called? Also, this button calls a javascript function before server side even.

View 5 Replies View Related

App Won't Run On Server?

Nov 24, 2010

I have an app which preloads images from a folder called 'myimages'; I load the images using src='myimages/picture.jpg'. The 'myimages' folder is in the same folder as my web pages.My domain on the server is villaswfrance.com and I have copied the 'myimages' folder to the server at the same level as the web pages which are directly under the villaswfrance folder. When the app runs it fails when trying to load /myimages/picture.jpg. Does the leading / take me to the web pages or to the villaswfrance folder. If the latter I understand why it fails - if the former I do not understand.

View 5 Replies View Related

How To Get Data From Server

Jul 23, 2005

What i want to do is that this function post data to the server (ASP) and
the server will response with 'OK' My question is how can i send data clientside from Javascript to the server ? (navigate ? with url ?)

and check the returned data in the same function ?

function ShowData(TxtArt)
{
alert(TxtArt + ' : ' + parent.frames.Bottom.TxtUsrName.value + ' - ' +
parent.frames.Bottom.TxtRemarque.value); // testing purpose
// post the data to the server. ex .. myURL.asp?userID=1000&Art=ART1201
// fetch the data from the server. to verify if the 'OK' is recieved ->
the server will response with 'OK'
// if 'ok' -> i will update clientside an frame (ex. contents of
shoppingbasket)
}

Any idea's ?

View 3 Replies View Related

Determine Name Or IP Of Server

Mar 30, 2006

I know it's possible to retrieve the IP address of a visitor's computer. However, I need to figure out a way to get the IP address of the server where the files are placed. Here's a description of my issue:

My application, along with some HTML Electronic manuals, are loaded onto a server in an electronic classroom. In order to get to any of these items (manuals or app), the students access the server where an index page is located in the D drive and click a link to get to any of them.

The problem is that these manuals are loaded into the D: drive while my application, because it uses ASP, is saved in the C:inetpubwwwroot folder.

The other issue is that this application will not be placed in just one classroom. Each classroom will have its own server with any number of computers accessing it. Since I don't know how each of the servers will be set up, I need to get the IP address so I can access the wwwroot folder.

What I need to do is figure out, using some non-server-side language, what the IP address or computer name of the server is so that I can access the appropriate folder in the wwwroot folder.

View 2 Replies View Related

Getting The Web Server Name Through Javascript

Sep 19, 2005

Is it possible to get the web - server name through Javascript? If yes, how?
My code goes as follows. I get an error after executing this

<html>
<head>
<title>Untitled</title>
<script>
function disp()
{
str1 = location.host();
alert(str1);
}
</script>
</head>

<body>
<cfoutput>
<a href="##" onclick="disp();">Click me</a>
</cfoutput>
<cfabort>
</body>
</html>

View 2 Replies View Related

Errors On New Web Server

Apr 17, 2006

I'v just finished the first web site i wrote which encorporates some javascript. It worked fine on my test server, but as soon as i moved it to the production box, I now get all sorts of errors like :Unterminated string constant when i open the first page, and Object expected when i try to call a javascript function by clicking on a menu item. Is there some sort of configuration that must happen on my production box? The same coding works fine on the one server but not on the other.

View 4 Replies View Related

Javascript On The Server Side

Jul 23, 2005

However, this piece of Javascript uses some other script which is large.

<script src = "./js/tmp.js".....>

This will work if the file "tmp.js" is local. However this reduces the
portability of my *utility* Javascript
as users have to have that "tmp.js" for every webpage they have (if they
want to use it :D)

I thought of uploading "tmp.js" it to somewhere and change my code to

<script src = http://www.somewhere.com/js/tmp.js ....>

The all the users have to do is copy the piece of code that I wrote
BUT THIS DOES NOT WORK. I TRIED IT.

My questions are:

1. Is there something wrong with server-side Javascript? Or am I missing
something?

2. Is there another way to make my code portable?

View 2 Replies View Related

Communicating To Server .php Without Using <form>

Jul 23, 2005

I'm trying to come up with a way within a client-side web page of uploading a couple files to a server-side PHP program without using a <form...>. I don't want to give up the page which happensafter the <form...> executes. Instead, I want to upload the files, then execute a <form...> for
another purpose.

View 6 Replies View Related

Get Server Dynamic Internet IP

Jul 23, 2005

how to get the server dynamic internet IP from javascript?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved