I've got an external server with an application that retrieves some information to display on a page if available. Data should be returned as a JSon object. I've got this to work locally for all browsers but for some reason when I put it onto a live website it will not work for certain browsers...
Here the code...
Code:
var servletaddress = 'http://www.applicationaddress.com/DataR/';
function getJson (type) {
var httpRequest = getHttpRequest();
[Code]....
If I deploy a *.html file into a locally running Tomcat fro example, the web page requests the data from the external server on [URL] for all browsers I've tested.
If I put this section of code up onto a live environment e.g [URL] the JavaScript will no longer work in all browsers eg IE6 yet still works in Chrome & Firefox...
Normally this would be security settings or something on the browsers I guess but its the same browser window locally as externally.
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
Code:
window.onload = initAll; var xhr = false; function initAll() { document.getElementById("makeTextRequest").onclick = getNewFile;
var sortableTable = new Class({:thumbsup: getOptions: function(){ return {[code]....
It works flawlessly on my dev page: http:[url].....But I am having issues with is on my live page: http:[url].....My first thought is that it could be a labeling issue (ie: I forgot to remove "/dev" when moving the HTML over to live) but after reviewing for an hour, I don't believe this is the issue.
I've a Javascript function that has to verify if a form field is empty or not. My function works fine on my local server (Vertrigo), but when I upload it on server (online), the function doesn't verify if form fields are empty or not.I'm not good in Javascript
<head> <script type="text/javascript" language="JavaScript"> function empty()
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).
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).
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 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:
Yesterday I started rewriting the xmlhttprequest functions to an oo equivalent, but as it turns out, I don't get it right:
Code:
function Request() { this.req=init(); this.req.onreadystatechange = this.processedRequest; //addEventHandler/attachEvent alternative //doesn't work either
function init() { try { if(window.XMLHttpRequest) return new XMLHttpRequest(); else return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { alert(e); } } }
var x=new Request(); x.send(url); //the processing function //the eventtrigger should activate the callback function //when the xml has been returned
It seems like the problem is that I don't get to my "this.req" in the processedRequest function. Can anyone see where the problem lies, it has been turning me crazy all weekend already.
1. - I am new to this 2. - Using the following .js file:
Code: function makeObject(){ var x; if (window.ActiveXObject) { x = new ActiveXObject("Microsoft.XMLHTTP"); }else if (window.XMLHttpRequest) { x = new XMLHttpRequest(); } [Code]...
Ive been playing around with xmlHTTPRequest and was wondering if i was programming a part of my code wrong.
what i want to do is have the browser access another part of my site using xmlhttprequest.
however, when i use xmlhttp.open("POST", 'http://xml.mysite.com/test.php') it fails, but if i use xmlhttp.open("POST", 'http://www.mysite.com/test.php') it works. Is access to another url restricted in xmlhttp?
var xmlDoc=document.implementation.createDocument("", "", null);
but in opera xmlDoc.load(...) won't work, so I use:
XMLHttpRequest, and I have all needed code... let's say it works...
So I got serviceRequest.responseXML and is there a way to initialize xmlDoc in my case ? I am asking because I have code that uses xmlDoc.load(...) in FF and all code that's need to futher work with XML written. So this would be comfortable for me to use xmlDoc instead of creating everything from start.
I'm fetching some HTML files with XMLHttpRequest and dumping the ResponseText into block elements; works fine except that single and double quotes are being displayed as question marks (inside of a black diamond in FireFox)
What's going on ? What is the workaround ? I've tried this:
I would like to use the xmlhttprequest-object to send an http request to my server. The http request is used to switch the light on through home automation.
However it's not working, and I can't find the problem.
Could it be that the apache-server is located on 192.168.0.21 and that the http request is sent to 192.168.0.21:8080?
var onreadystatechange= func; this.method = "GET"; this.get = function(url) {
var request = null; var state_change = function() { if (request.readyState==4) { if (request.status==200) { onreadystatechange(request); } else { return null; } } }
try { request = new XMLHttpRequest(); } catch(e) { try { request = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { return null; } } if (request===null) { return null; } request.onreadystatechange = state_change; request.open(this.method, url, true); request.send(null); } } var req = new XML_request(function(response) { response = response.responseXML alert(response.getElementsByTagName('blah')[0].firstChild.data); });
req.get('index.php?mode=blah&a=response')
i didn't like the examples I found so this is suitable.. I only tested in ie and firefox though.. so let me know what I may be missing.. or criticism in general.
I'm working on an application that uses ajax and we are going to have a version that people with browsers that don't support the XmlHttpRequest object. My problem is what's the best way to check this.
I have tried the following
var xmlreq = new new XMLHttpRequest(); if (!xmlreq){ // handle the browser stuff }
In netscape 4.7 this results in an error that I don't seem to be able to recover from and I don't think this is the best approach to this problem.
While accessing my web service i am getting XMLHttpRequest status=0 in Crome/Mozilla and in IE getting XMLHttpRequest status=406. What is the solution for it so that i will successfully get responseText from server? I have tried accessing my html code with localhost but its getting same error,while when i run my code in that localhost location through local drive then it's working. why this is happning i didn't get?
Works perfectly, the script loads and executes. But calling XMLHttpRequest.open accessing Domain B from within this script doesn't work: Permission denied.
Now, I know of the cross domain security rule, but why can I load a script from Domain B, but not make a request with XMLHttpRequest to Domain B? Alle the counter scripts do exactly this... Any advice?
I'm using Firefox 1.5 and FCKEditor in a CMS app. Everything works in older versions of Firefox but in 1.5 I get a javascript error saying that the XML file holding the styles can't be loaded. Here is the code where the xml request is made:Code:
FCKXml.prototype.LoadUrl = function( urlToCall ) { var oFCKXml = this ;
The code I am writing fetches a csv file with weather data and updates the contents of the page every 5 seconds. It works correctly as far as I can tell in Firefox, IE, and Chrome. In Safari it works correctly the first time it loads but gives the following error any time after that.
Error: NETWORK_ERR: XMLHttpRequest Exception 101 I've searched for this but couldn't find anything that seemed to be similar to the issue I'm having. The error occurs on the xmlhttp.send(null); line.
Code: function getFile(url) { var file_url = url + '?t=' + ((new Date()).valueOf()); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest();
I have a web app, written in Javascript, that communicates to a back-end server via XMLHttpRequest.
The logic goes:
* Login * Perform transaction * (delay while the user does something) * Perform transaction * ... * Logout
It would be really convenient if I could make the whole thing a single HTTP connection. That way, I avoid needing IPC and session management at the server end, and a single instance of a CGI script can represent the entire session. When the socket gets closed, the CGI script terminates and implicitly logs the user off. All very simple.
Can I use HTTP pipelining with XMLHttpRequest to do this? The docs seem to say (it's quite hard to tell) that I have to call open() after each send(), which will presumably create a new HTTP session. Can I 'persuade' the browser to reuse an existing session?
I am trying to implement XMLHttpRequest to a new website, but when I include HTML, the code appears as is, instead of the formated HTML. Please have a look and click the 1st link ("L'Association") on top (yello horizontal bar on top): Code:
I have a form in a webpage that I want to submit and get the result back without reloading the page.
I've seen many times ppl using text/x-www-form-urlencode but I was wondering if it was possible somehow to submit the form element directly so I wouldn't have to process the form to put it in a string.