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
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;
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.
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?
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?
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.
I have a script which needs to detect when the internet connection is lost and hold the content of the web page until the connection is restored.
I have been given a head start with a small javascript which I am trying to get to work.
My web page, I have a web page which contains some text and graphics but more importantly it also has an iFrame. The iFrame connects to an SQL database and displays data which is refreshed every 20 seconds.
Because the internet connection at the location where the script will be running I get connection loss which makes the iFrame loose its data. The Javascript I am working with is below.
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.
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) }
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.
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.
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??
I am attempting to create an Access database connection from within an HTML page. I am using Javascript to make the connection and then test a basic UPDATE statement.
The following code is throwing back an error 'UPDATE statment syntax incorrect'
Code:
I thought the syntax was correct, but maybe it is something else?
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
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.
I want to execute server code invoked from inside Javascript code.
I will have my server code in a servlet, callable with a URL, but how do I invoke the servlet from Javascript without reloading the page and not opening any window? I mean, I don't want to display the HTML result of this request.
I'd like to implement a server socket in java: something linke the following example.
The problem is that the HTML has not the permission to execute instruction serverSocket = Components.classes["@mozilla.org/network/server-socket;1"]. createInstance(Components.interfaces.nsIServerSock et);
Question:
1 - how do I give it this permisison?
2 - one solution I thought was to put the javascript code in a firefox extension, to load, so it should have all needed permisison, but, How can I call a java script function define in an extension from an html page? - there's some particular syntax? ....
I have to create a web page to give to clients that is shipped on CD. The idea is that they would open the page and it would display in their web browser.
What this will do is to provide a list of most recent changes to the software we're shipping. The idea is that there would be an un-ordered list <ul/> with a list of changes (not sure of final desired mark-up).
What we want to do is to get the developers to edit a file that simply contains a list of changes, putting in minimal markup. This "changes" file would then be "included" in some way into a parent file that contains all the branding and other information. We don't want the developers to have to navigate their way around this parent file looking for where to edit it.
As this page will be launched in a browser from disk, there won't be any help provided by a web server, so I'm really stumped as to how to accomplish this....could it be done with JavaScript at all?
I have three different web pages with different domains, and I want to show some pages of one of the webs in the others.
I use an iframe for this and it shows it good until I have to call a javascript function in the iframe inside page, I have a permission denied because the domains of these pages are different.
So, the cuestion is:
Is there some way to call the javascript function of the iframe from the parent page?
I might be turning a corner today and seeing the light. I might still be confused :)
If JavaScript is the language for the browser then why do servers use Ruby/Rails, Perl/Catalyst, Python/Turbogears or PHP/Cake? Is it because the prototype-based language is too different to be chosen except when necessary. Is it because browser bugs make people think JavaScript is bad? Is JavaScript not suitable for the server-side for any reason?
I imagine that if server-side programmers started to learn JavaScript then the client-side code in the world might start to improve. Translation layer libraries like Prototype.js or Mochikit wouldn't need to exist. The more I learn about JavaScript the more I like it. It is difficult to learn however for multiple reasons.
I have seen web pages sites, when you drop down a list box, it seems to go back to the server to retrieve some data without reloading the whole page (e.g. select make of car and it retrieves a list of models from the server to populate another list box).