XMLHttpRequest continually suggests I like the word 'undefined'


I'm almost positive this is the Javascript code, because it was working until I copied and pasted my code into the function for a more efficient method of doing things. Just take a look at it, and tell me if you see something wrong. Javascript error console says nothing.

function yuigo(valname, values, id1, id2, filename) { var val = document.getElementById(id1).value; var callback = { success: function(o) { if (o.responseText.substr(0, 4) == "Nice") { document.getElementById(id1).style.border = "solid green 4px"; document.getElementById(id2).innerHTML = this.responseText; } else { document.getElementById(id1).style.border = "solid red 4px"; document.getElementById(id2).innerHTML = this.responseText; } }, failure: function(o) { document.getElementById(id1).style.border = "solid red 4px"; document.getElementById(id2).innerHTML = "orlynao"; } }; YAHOO.util.Connect.asyncRequest('POST', filename, callback, valname+"="+values); } function xmlEmail() { var val = document.getElementById("email").value; yuigo('emailadd', val, 'email', 'changer1', 'emailver.php'); }
Posted On: Thursday 29th of November 2012 08:22:03 PM Total Views:  371
View Complete with Replies

RELATED TOPICS OF JavaScript PROGRAMMING LANGUAGE




why am I getting xmlhttprequest.status=0?

Here is the code copied from w3schools ( http://www.w3schools.com/ajax/tryit.aspfilename=tryajax_suggest): function showHint(str) { if (str.length==0) { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState == 4) { alert("I am ready status: "+xmlhttp.status); } if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","http://www.w3schools.com/ajax/gethint.aspq="+str,true); xmlhttp.send(); } Start typing a name in the input field below: First name: Suggestions: I saved this as firstAjax.html in my hard disk. I typed the url: http://www.w3schools.com/ajax/gethint.aspq=u and get result "Unni". Then I modified firstAjax.html and inserted the url (as can be seen from above). When I type something in the text box of firstAjax.html, nothing shows up. So I put an alert to show the status. It prints: "I am ready status:0". This is weird, isn't it Because the same url can give results from firefox. But the same url can not work for the same code from the same source. I checked javascript error console which is clean. Besides as it is entering here: xmlhttp.onreadystatechange=function() {...} so the browser supports ajax. Some correction, I tried the code with IE8 where it works. The firefox is the latest one 3.6.3 where it doesn't work. Is there any security settings that need to be enabled to make it work As it is the recent one (2010 release) and it doesn't complain about manipulation of xmlhttp so it is supposed to work (gmail and others work). Got any ideas
VIEWS ON THIS POST

146

Posted on:

Saturday 10th November 2012
View Replies!

xmlhttprequestObject behaves weird

Hi , AJAX beginner here... 1. I have a function in .js that creates and gives me xmlhttpRequest-object. It works fine when I call it from a few .js files of my project, but has just started returning null value to a call from one of the .js files which worked BEFORE !! 2. I have a few functions that deal with the xml response sent to it. It works great except that the same code in one of those functions now gives me a null value...! I get a message like 'cannot call getElementsByTagName() of null' when i try to call xinfo.getElementsByTagName('item') I am using wamp and Google Chrome. will greatly appreciate any help/suggestions...
VIEWS ON THIS POST

149

Posted on:

Monday 19th November 2012
View Replies!

clickable context menu + mousemove code continually, any have ideas?

Ok, so i will post a lot of code here, but essentially this is the breakdown. The exact thing i am trying to do is to make a context menu, which 1 of the items will be "adjust width" and when the item clicked pops up the menu, it will allow you to click the 'adjust width' button, which will bind the width of the clicked item to the pointer. The pointer is bound to the width so that the user can drag and adjust the width (sort of like form creation in visual studios or other form creation software) and then when the user clicks, it would unbind the mousemove and the width would be set. Is there a better way to do what i am thinking I was trying to make use of examples from the following 2 sites, and put them together. http://jsfiddle.net/EbbxA/ http://www.harelmalk...m/rightcontext/ I am making an editor of sorts, which needs a rightclick context menu. I found a tool called "rightContext.js" It wont let me update the files, or i would. Says i am not permitted to upload neighter .js or .aspx files. QuoteRightContext v0.2.5 Author: Harel Malka http://www.harelmalka.com harel@harelmalka.com Bugs: Leave comment on the site February 2007 - Initial Revision
VIEWS ON THIS POST

156

Posted on:

Monday 19th November 2012
View Replies!

XMLHttpRequest continually suggests I like the word 'undefined'

I'm almost positive this is the Javascript code, because it was working until I copied and pasted my code into the function for a more efficient method of doing things. Just take a look at it, and tell me if you see something wrong. Javascript error console says nothing. function yuigo(valname, values, id1, id2, filename) { var val = document.getElementById(id1).value; var callback = { success: function(o) { if (o.responseText.substr(0, 4) == "Nice") { document.getElementById(id1).style.border = "solid green 4px"; document.getElementById(id2).innerHTML = this.responseText; } else { document.getElementById(id1).style.border = "solid red 4px"; document.getElementById(id2).innerHTML = this.responseText; } }, failure: function(o) { document.getElementById(id1).style.border = "solid red 4px"; document.getElementById(id2).innerHTML = "orlynao"; } }; YAHOO.util.Connect.asyncRequest('POST', filename, callback, valname+"="+values); } function xmlEmail() { var val = document.getElementById("email").value; yuigo('emailadd', val, 'email', 'changer1', 'emailver.php'); }
VIEWS ON THIS POST

206

Posted on:

Wednesday 21st November 2012
View Replies!

Problem with Ajax xmlhttprequest object

, I am trying to create an xmlhttprequest object to update the shopping cart on my web page without submitting the entire page to the server for processing. However, what I have done so far is not working. that is happening when I click the "update cart" button is the page sort of flashes and the check marks in the remove item check boxes disappear. The first code snippet is the "traditional" way of submitting the whole page to the server for processing - and it works. The second snippet is what I have done to try and implement AJAX to submit only the shopping cart - and it does not work. Any hints, suggestions, anything will help. Thank You, Dawn Manage Shopping Cart function displayCheckout() { window.open("http://localhost:8084/AjaxBooks3/formassignment.html") } Shopping Cart 0){ %> Continue Shopping function displayCheckout() { window.open("http://localhost:8084/AjaxBooks3/formassignment.html") } var updateReq = new xhr(); function makeRequest(){ var updateReq = new xhr(); updateReq.onreadystatechange = updateCart; updateReq.open("POST", "updateCart.jsp", true); } function updateCart(){ if(updateReq.readyState == 4){ if(updateReq.status == 200){ document.getElementById('update').innerHTML = updateReq.responseText; } Shopping Cart 0){ %>
VIEWS ON THIS POST

139

Posted on:

Wednesday 21st November 2012
View Replies!

validation doen't like this javascript

http://www.lincolnsrealdeals.com/loc2f.php produces three javascript errors: Line 49, Column 27: character ";" not allowed in attribute specification list Line 49, Column 27: element "innerdivs.length" undefined Line 54, Column 9: end tag for "innerdivs.length" omitted, but OMITTAG NO was specified What are the errors really saying
VIEWS ON THIS POST

163

Posted on:

Saturday 24th November 2012
View Replies!

can we do like this....?

, i had a php page.i am using ajax for displaying a table. When i select a date images uploaded on that date gets displayed in a table.This is working fine.But i need another button for edit.so when i click on edit those images present in table should become editable. (OR) i am passsing a date value through url in line25. so can we pass button value also in the same url(which is in line53)...\t\t function showUser(str) { if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","useajax.phpq="+str,true); xmlhttp.send(); } $(function() { $("#datepicker").datepicker(); }); Logout Choose Uploaded date Images information will be listed here.
VIEWS ON THIS POST

216

Posted on:

Saturday 24th November 2012
View Replies!

Adding facebook "like" to a sentence

I have seen some websites that you can "like" a sentence off a website. I have been on facebook developer's page and noticed the meta tags that you need to use but that is for a whole page. Is there a way I can do incorporate a like button to a sentence
VIEWS ON THIS POST

143

Posted on:

Saturday 24th November 2012
View Replies!

xmlhttprequest does not work if accessed inside iframe?

i've created a form like this send.php is used to save data posted from the form, and call a function called getURL in main window parent.getURL('thankyou.php') function getURL(url){ var xmlHttp=GetXmlHttpObject(); function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ document.getElementById('maindiv').innerHTML=xmlHttp.responseText; } else { document.getElementById('maindiv').innerHTML = document.getElementById("divloading").innerHTML } } xmlHttp.onreadystatechange=stateChanged ; xmlHttp.open("GET",url,true); xmlHttp.send(null); } if getURL called from send.php using above syntax, the xmlHttp.readyState value is never reach something after 1 and getURL never finished. Please note that this problem happened only if getURL is called from inside iframe, and using Opera. Firefox doesnt suffer from this problem. Does anyone has any idea to solve the problem
VIEWS ON THIS POST

190

Posted on:

Saturday 24th November 2012
View Replies!

is it possible to save result like this example

Hi I am trying to do something with Jquery and Ajax But I am not sure that its possible or not. its an example about it http://www.unikhas.org/design/index.jsp I want to save all the things after I desing my tshirt. Is it possible to do that in Jquery or Ajax or should I use other technologies
VIEWS ON THIS POST

147

Posted on:

Sunday 25th November 2012
View Replies!

People like Yaldex slow down the progress of web development

I've been using a tool called Antechinus JavaScript Editor for a while now and it gets the job done pretty good I must admit. When I Googled for JavaScript editor yesterday, Antechinus JavaScript Editor has dropped to the second place, overtaken by 1st JavaScript Editor Pro. What so-called "1st" JavaScript Editor Pro have done is steal half the design from Antechinus (for example look at calling javascript functions or run any piece of code with one click it is exactly the same). Apart from the design they also stolen the text from the Antechinus JavaScript Editor page at http://www.c-point.com/javascript_editor.php and used it almost EXACTLY as it is on their own pages at http://www.yaldex.com/JSFactory_Pro.htm ! Pure theft and unethical, yes, but this has worked very well for Yaldex so far they are on top of the search results. Unfortunately this screws up legitimate companies who actually take the time to come up with new and innovative features.
VIEWS ON THIS POST

164

Posted on:

Sunday 25th November 2012
View Replies!

Would like to pass two parameters to a function that?

my application makes extensive use of the Google map and I would like to know how I can pass latitude and longitude information obtain from one page to the next. the function I like to access exist in a completely different web page located on our server. The problem seems very straight forward but I don't know how to accomplish the task. However, I would appreciate anyone who can point me in the right direction., Yes. the event is user initiated. I figured when the user initiated the event, I can pass the lat and long value to the next page while loading and accessing the event.addlistener method of that page. what I would like to see happened is to have pass the arguments from the previous page to the next page and have the info window opened once its fully loaded (pretty much your first assumption). I think the query string location.href.... would work well, however I don't see how I can automatically call the event.addlistener from that point., if were simply talking about web design then again i agree with SOS but for web application terms or other such i stand by the fact that popups can be incorporated to enrich a users experience., Happy
VIEWS ON THIS POST

156

Posted on:

Sunday 25th November 2012
View Replies!

Adding some dropdown like javascript to my page

I want to make a like this example. Cliking at any question it shows the whole, and clicking for the second time it hides. I want this effect. http://mentor.templates.pixelentity.com/faq.html Is there any code snippets for that. I need the code. WHAT IS THE NAME OF THIS EFFECT Help! Jahur
VIEWS ON THIS POST

137

Posted on:

Monday 26th November 2012
View Replies!

Need to build a custom function like this, what is?

I want to build a site like art.com, I can make a shopping cart by using any popular platform like magento, opencart or cs-cart, but the site which i mentioned has couple of unique feature, you can see them here http://www.art.com/frameStep/pd=12818514405&sp=A&APNum=8656266&PODConfigID=4990875&EmailID=&ui=A5597B7167F340178A8A9709586F2FBA&customerzoneid=3 Once you go there, please click on "mats tab" and see how they have "how many mats would you like" and have 0,1,2,3 on it. I want to do this, user should also be able to change width of the mat down to 1" or increase as they prefer like shown here. Also please check the "mat details" link, and then click on "change", here user can change the width of border. How can I achieve all this, is there any Jquery plugin for it Can I do this thing with Jquery and AJAX When user has done all the changes how can I submit changed look and feel of the art into database, so that user can add it to cart to order further Please guide me from where should I start or learn and what are the best available platforms
VIEWS ON THIS POST

149

Posted on:

Monday 26th November 2012
View Replies!

landing page like google

peeps! Any idea how to make a search result landing page like Google image result Like the one when you click one image it redirects you to an image preview first before it redirects to the source of that image. I was thinking it could be AJAX, but I'm not sure yet. Any ideas would be appreciated and could be a great help.
VIEWS ON THIS POST

357

Posted on:

Monday 26th November 2012
View Replies!

Answer editor like this forum's ?

Hi all. Can anybody point me in the right direction as to how to implement the editor that opens up when I click Start new thread or post reply Also when displaying the replies how is the feature with syntax highlighting and indentation for the code snippets implemented
VIEWS ON THIS POST

146

Posted on:

Monday 26th November 2012
View Replies!

how to detect hosts like rhino,WSH or browsers

i'm trying to detect the host so that the print function if detected WSH print should call WScript.Echo(obj) if detected Rhino print should call java.lang.System.out.println(obj.toString()) if detected Browser create a console for output using Javascript/DOM and print should call like console.print(obj.toString()) or console.innerHTML = obj.toString()... is there anyone who can help me in doing this out
VIEWS ON THIS POST

182

Posted on:

Monday 26th November 2012
View Replies!

Like/dislike buttons - Harder than it sounds! - JavaScript Help

So I want to have a pair of radio buttons: 'Like' and 'Dislike' that the user can select. Each pair of radio buttons is to be attached to a unique post-id div.I also want a pair of check boxes: "Hide Liked" and "Hide Disliked".What I want to do is have the user be able to select whether he likes or dislikes each post and when he checks off 'Hide Liked', all the posts attached to the radio buttons marked 'Like' disappear. The same for "Hide Disliked".This is the code I have so far but the problem is that the checkbox turns the radio button On and Off and obviously, I want them to work individually so that when the box is checked, the radio buttons remains On or Off as per the user's selection. Furthermore, how can I get the javascript to take into account all Div IDs (they will be numbered) that get added in the future as new posts are made/old posts are deleted Unhide on checkboxes/radio buttons function toggleLayer(val) { if(val == 'on' || val === true) { document.getElementById('a1').checked = true; document.getElementById('layer1').style.display = 'block'; } else if(val == 'off' || val === false) { document.getElementById('a2').checked = true; document.getElementById('layer1').style.display = 'none'; } } Unhide Layer Form On Off Check Me: You can now see this.
VIEWS ON THIS POST

145

Posted on:

Tuesday 27th November 2012
View Replies!

HELP Looking for script like.... - JavaScript Help

I recently stumbled upon a script that would be perfect for my site, but I don't know how I can get it on my site.I searched google for a similar script, but I wasn't really sure what to search for:(So though you might be able to help.The script I'm talking about is on ehow.com under the "What's Happening Now" box. (it pushes up the new content
VIEWS ON THIS POST

172

Posted on:

Tuesday 27th November 2012
View Replies!