SEARCH YOUR SOLUTION HERE  

javascript and ajax - JavaScript Help

So ive called a page with ajax but the called page's javascript doesnt work, what am i missing

main.html
function Data($Request, $Control, $jump, $player) { if($jump){ window.location = String(window.location).replace(/\#.*$/, "") + "#top"; } if($player){ document.getElementById("more").style.display = "block"; } if ($Control == "" || $Control == null) {alert ("No output specified !"); return;} var ai = new AJAXInteraction($Request, GetServerData, $Control ); ai.doGet(); } function GetServerData ($TheData, $Control){ document.getElementById($Control).innerHTML = $TheData; } function AJAXInteraction(url, callback, $Control) { var req = init(); req.onreadystatechange = processRequest; function init() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); } else if (window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); } else {alert ("Your browser seems to be out of date, Please update!"); return; } } function processRequest () { if (req.readyState == 4) { if (req.status == 200) callback(req.responseText, $Control); } else callback(Myvar , $Control); } this.doGet = function() { req.open("GET", url, true); req.send(null); } } Click

page.html
..javascript stuff here

Posted On: Tuesday 27th of November 2012 09:10:38 PM Total Views:  128
View Complete with Replies




Related Messages:

ajax form not finding javascript function   (204 Views)
Hi! I can't seem to figure out what I'm doing wrong with this no matter how many things I try. I've looked through Google for a related issue but found nothing specific. Hopefully someone can help me. The script runs through a external .js file calling a list of music albums, then listing the song of the album chosen via ajax. The user can then edit of delete the songs. Everything works fine until I submit the edited information through a form. When I click the submit button I get a web developer error "updateSong is not a function" Here's the form which is loaded into the already existing page via ajax:
ajax+php+mysql   (207 Views)
, I'm trying to use Ajax to update a field from a mysql table, but I cannot find a way to make it work (I really don't know too much about ajax) I have this right now. Ajax code function delete(){ xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support AJAX!"); return; } var url="discon.php"; xmlhttp.open("POST",url,true); xmlhttp.send(null); } And this. php code
passing javascript array to ajax   (202 Views)
HI, can we pass a java script array as an argument to php using ajax request. i am trying the following code but it's not working. can any one help me pls.. java script function showCalendar() { var arr=new Array(1,2,3,4,5); alert(arr.length); xmlHttp=GetXmlHttpObject(); if (xmlHttp==null){ alert ("Browser does not support AJAX - Please update"); return; } var url="getArray.php"; url=url+"arr="+arr; xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById("show").innerHTML=xmlHttp.responseText; } } function GetXmlHttpObject(){ var xmlHttp=null; try{ // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e){ //Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e){ xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } php code i want to catch the array from java script. Then i want to do some stuff with array and again i want to return back that array to java script. is it possible.
php mysql ajax populate multiple textbox   (218 Views)
Dear ajax expert, http://www.w3schools.com/php/php_ajax_php.asp Refer to the link, using the sample, I'm able to use php ajax to populate 1 text box which I've already pre-define (not using "echo '
Refresh php with ajax   (130 Views)
. I'm wondering if anyone has knowledge or a code that will refresh a script without a full page load. Just a widget/box on a site. What I have is a script which displays random posts in wordpress. Just calls 5 posts from the database with a simple random call. What I would want is to have a button/image that when clicked the random call is executed again without a full page load. Any clues
Dynamic content using ajax   (196 Views)
Dear viewer, I've got a database with the tables Category, Subcategory and Products. I've been able to get this far; Click on category -> shows the subcategories for that category Click on subcategory -> shows all products for that subcategory Now I've been looking around how to do it in Ajax, but I haven't come around anything useful, perhaps I just didn't look good enough but okay. I know I'll need to use an eventhandler on click, but other than that I don't know. Thank you sincerely for your help. Tom
scriptaculous by ajax   (131 Views)
, I'm loading some part of the page by Ajax, and in this part i have a slide toggle using the scriptaculous.js library, which don't work when I'm using Ajax. Is this normal, because checking the page code, it seems unchanged by the Ajax script
ajax is not working on onsubmit   (223 Views)
i have a simple form validation onsubmit event. The requirement is very simple, if validate.php brings any error it shows errors and it stops form for further processing else form submit and action runs process.php. But, unfortunately ajax function is not working onsubmit event.. any help please..... files are attached except html code which is here test form Your name: , Hi servis, you could try this thread and see how I made an AJAX call via the onsubmit handler. hope it helps you..., thank you Graphix for your reply. i tried your suggested code, but the matter is, on pressing submit form bypass onsubmit function and execute process.php directly without validation, ohooooo, it is now working very much fine...yes you are right i have no experience in js and ajax....thank you Graphix for kind replies..... please give me a hint, how can i validate multiple form inputs...
Hekp with ajax slideshow   (230 Views)
okay i've spent hours in the web searching for the right image slideshow/gallery to use for my website but in vain! Dont get me wrong the jQuery, Ajax scripts i've seen so far are so good but they all use lists to load all the images at once and yet i'm targeting an area with not-so-much-bandwidth. Is there an image gallery script around that uses ajax to maybe fetch an image from an external file and display it on the page hope this makes sense!
Question about pop up window(js) inside dynamic ajax?   (191 Views)
My problem at the moment is a bit different than specified in topic title. I have an Iframe which displays .html file with js/ content slider when i click a link inside of that iframe I want for pop up window (greybox) to appear, but not inside of iframe , outside of it. I found a section of developers page about this, but I don't seem to be able to do this.. http://orangoo.com/labs/GreyBox/FAQ/#q12 I undersand that I must leave greybox folder/files where they normally are located! Do i need to add something more to Visit Google as I just copied it. with no changes ..
ajax captcha   (158 Views)
hello i am searching a ajax captcha from some time which have following properties, - intimate user for wrong verification code without refresing ... 2ndly - if the user enters the right code, it process the form normally. unfortunately i could not find reqired script. please help me any body.
need to autofill the textbox using ajax:autocomplete   (183 Views)
Hi frnds, I m new to ajax. I have implemented the ajax autocomplete It is working alright,but i need that when the autocomplete list has been populated,and down key is pressed the option in list should auto fill the textbox accordingly as the user presses up/down key over the autocomplete list. Please reply to this... I would be really
Unable to call ajax function in a loop   (169 Views)
Hi Plz reply..its urgent I am trying to track progress of a database operation . and want to dislplay percentage progress on page asynchronously. Process.jsp - In this i used javascript to call ajax function continuously which returns precentage progress. My Code is : Untitled Document var j=0; function repeat() { var i=0; while(i!=1) { i=getPercentage(); alert ("i = " + i); } } function getPercentage() { var xmlhttp; if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else if (window.ActiveXObject) { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } else { alert("Your browser does not support XMLHTTP!"); } xmlhttp.onreadystatechange=function() { if(xmlhttp.readyState==4) { document.myForm.time.value=xmlhttp.responseText; if(document.myForm.time.value=="100") { alert("final reached"); j=1; } } } xmlhttp.open("GET","test.jsp",true); xmlhttp.send(null); alert ("j=" + j); return j; } Name: Time: Track Progress So that when user clicks on track progress button, It calls a repeat () function which continuously calls getPercentage() function and break when i=1 (Value returned by getPercentage is 1 when it is 100 %). But it is not functioning properly. can some one tell what is problem. code of test.jsp
ajax line animation   (186 Views)
I'm pretty much a noob to ajax but I'm trying to get me head around it and have been very impressed so far. I'm stuck with trying to make/find a script though. I want a line to be drawn from one button to a series of others when you click it. Fairly similar to the navigation on this site, http://www.a2sm.lt , but not exactly the same. Also that site does it in flash which I generally try to avoid.
ajax framework with drag and drop auto arranging grid?   (216 Views)
I'm new to the UI side of AJAX, and I was wondering if there was any AJAX framework (or an extension to the framework) which has the functionality like this: http://tool-man.org/examples/sorting.html (scroll down to the section "Example: Sorting in two dimensions")
how to know that a perticular website using ajax or?   (132 Views)
hi, i m in to performance testing. so for me to mandatory to know that whether a website using ajax or not an if yes ,what are different things associated with it in that perticular webiste so can any body tel me, is there any way to know that whether any perticular site using ajax or not its urgent. Thanx in advance.:)
Photo Scrolling/ carousel similar as Flickr(ajax+aspvbscript   (188 Views)
helo there, i need some help on some image/photo slide show display. i would like to do a photo carousel function similar as the http://www.flickr.com/photos/69864550@N00/320622773/ . the function i would like to do is on tis flickr.com web at the right hand side for tat photo stream http://i263.photobucket.com/albums/i...2008/image.jpg let say in my album have 100 photo. and from tis funciton, it will not load out all my 100 photos when the page is loaded. it will load the others photo when i click on the NEXT arrow button. i need some help on tis funciton and implement it with ASP VBscript code. please help me....
ajax server-returned message?   (176 Views)
hi, i understand that the xmlHttp.responseText; attribute would return the server's message, but is there any way to get only ajax object's error messages see, i have a case. lets say i have two different span on my page. if ajax's object is throwing an error, i want it displayed on 'system' span. Otherwise if everything's normal, a tabled result will show in 'display' span. Is this possible
Hint Box in ajax   (259 Views)
Friends In some websites i have seen that in a website called mginger.com in that invite tab when i keep a mouse over the Text field in the right hand side of it shows that please enter the name in a layer .It looks very nice .My friend says that its an ajax.How to do that please anyone help me very urgent requirement
refresh page after ajax request and after client-side removal of DOM element - JavaScript Help   (159 Views)
How can i reload the page in this jquery function $(document).ready(function(){ $('table td a.delete3').click(function(){ var del_id = $(this).parent().attr('id'); var info = 'del_option_id=' + del_id; if(confirm("Zeker dat je deze optie met id " + del_id + " wilt verwijderen")){ $.ajax({ type: "POST", url: "deleteActies.php", data: info, success: function(){ } }); $(this).parent().remove(); } return false; }); });First the ajax call should be finished, then the element (an option belonging to a question) should be removed --> $(this).parent().remove() and then the page should be reloaded.