Search Results

Search found 378 results on 16 pages for 'responsetext'.

Page 8/16 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Question about AJAX

    - by Doug
    function showHint(str) { if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("games").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","hw9.database.php?name="+str,true); xmlhttp.send(); } I'm learning AJAX at the moment. The code here basically receives the echo from the PHP and then puts it in element id games. My question is, if I wanted to have AJAX send 3 different http requests to 3 different PHP scripts and if I wanted to retrieve data from each one and then put it in 3 different element id's then would I make 3 copies of this same function? I would imagine that there should be a more efficient way. Thanks!

    Read the article

  • How to resolve "Could not convert JavaScript argument arg 0 [nsIDOMHTMLDivElement.appendChild]" erro

    - by Holicreature
    i have a json object returned from ajax and when i alert it, it is displayed correctly and i try to add those into a unordered list and add that to a place holder div, but throws the above error.. function handleResponse() { if(httpa.readyState == 4){ var response = httpa.responseText; //alert(response); if(response!='empty') { //alert(response); eval("prod="+response); var len = prod.length; var st = "<ul>"; for(var cnt=0;cnt<len;cnt++) { st = st + "<li onclick='set("+prod[cnt].id+")'>"+prod[cnt].name+"</li>"; } st = st + "</ul>"; } var tt = document.getElementById('holder1'); tt.appendChild(st); // i even tried **tt.appendChild(eval(st));** tt.style.display = 'block'; } }

    Read the article

  • Capturing the contents of <select>

    - by joey mueller
    I'm trying to use a regular expression to capture the contents of all option values inside an HTML select element For example, in: <select name="test"> <option value="blah">one</option> <option value="mehh">two</option> <option value="rawr">three</option> </select> I'd like to capture one two and three into an array. My current code is var pages = responseDetails.responseText.match(/<select name="page" .+?>(?:\s*<option .+?>([^<]+)<\/option>)+\s*<\/select>/); for (var c = 0; c<pages.length; c++) { alert(pages[c]); } But it only captures the last value, in this case, "three". How can I modify this to capture all of them? Thanks!

    Read the article

  • ajax strange error with sending multiple parameter

    - by kawtousse
    hi everyone, please check with me where is the error in this ajax code to send 2 parameters: var xhr = getXhr(); // On défini ce qu'on va faire quand on aura la réponse xhr.onreadystatechange = function(){ // On ne fait quelque chose que si on a tout reçu et que le serveur est ok if(xhr.readyState == 4 && xhr.status == 200) { selects = xhr.responseText; // On se sert de innerHTML pour rajouter les options a la liste //document.getElementById('prjsel').innerHTML = selects; } }; xhr.open("POST","ServletEdition",true); xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); id=document.getElementById(idIdden).value; fu=document.getElementById("formUpdate").value; //alert(fu); var i=1; xhr.send("id=" +id+", fu="+i); i cant got the value of fu i don't know why. thanks

    Read the article

  • Why is the value not passed to my controller page in codeigniter?

    - by udaya
    I am selecting state from country and city from state. This is my country select box: <td width=""><select name="country" onChange="getState(this.value)" class="text_box_width_190"> <option value="0">Select Country</option> <? foreach($country as $row) { ?> <option value="<?=$row['dCountry_id']?>"><?=$row['dCountryName']?></option> <? } ?> </select></td> This is my state select box: <select name="state" id="state" class="text_box_width_190" > <option value="0">Select State</option> </select> This is my city select box: <td width=""><div id="citydiv"><select name="city" class="text_box_width_190"> <option>Select City</option> </select></div></td> This is my script: <script type ="text/javascript"> function getXMLHTTP() { //fuction to return the xml http object var xmlhttp=false; try{ xmlhttp=new XMLHttpRequest(); } catch(e) { try{ xmlhttp= new ActiveXObject("Microsoft.XMLHTTP"); } catch(e){ try{ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e1){ xmlhttp=false; } } } return xmlhttp; } function getState(countryId) { var strURL="http://localhost/ssit/system/application/views/findState.php?country="+countryId; var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { // only if "OK" if (req.status == 200) { document.getElementById('statediv').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } } } req.open("GET", strURL, true); req.send(null); } } function getCity(countryId,stateId) { var strURL="http://localhost/ssit/system/application/views/findCity.php?country="+countryId+"&state="+stateId; var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { // only if "OK" if (req.status == 200) { document.getElementById('citydiv').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } } } req.open("GET", strURL, true); req.send(null); } } </script> This is my find state page: <? $country=intval($_GET['country']); $link = mysql_connect('localhost', 'root', ''); //changet the configuration in required if (!$link) { die('Could not connect: ' . mysql_error()); } mysql_select_db('ssit'); $query="Select dStateName,dState_id FROM tbl_state Where dCountry_id='1'"; $result=mysql_query($query); ?> <select name="state" onchange="getCity(<?=$country?>,this.value)"> <option value="0">Select State</option> <? while($row=mysql_fetch_array($result)) { ?> <option value=<?=$row['dState_id']?>><?=$row['dStateName']?></option> <? } ?> </select> This is my find city page: <? $countryId=intval($_GET['country']); $stateId=intval($_GET['state']); $link = mysql_connect('localhost', 'root', ''); //changet the configuration in required if (!$link) { die('Could not connect: ' . mysql_error()); } mysql_select_db('ssit'); $query="Select dCityName,dCity_id FROM tbl_city Where dState_id='30'"; $result=mysql_query($query); ?> <select name="city"> <option>Select City</option> <? while($row=mysql_fetch_array($result)) { ?> <option value><?=$row['dCityName']?></option> <? } ?> </select> When I post a country, I can receive it but I can't receive my state and city. How to receive them?

    Read the article

  • AJAX works fine in firefox, but malfunctions in Mozilla Prism 0.9

    - by Babiker
    I have the following ajax fucntion: function ajax(value, url, urlVarname, displayContainers_id){ if(value == ''){ document.getElementById(displayContainers_id).innerHTML=''; } /* THIS IS LINE 12*/ xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange=function() { if(xmlhttp.readyState == 4 && xmlhttp.status == 200){ document.getElementById(displayContainers_id).innerHTML=xmlhttp.responseText; } } xmlhttp.open('GET',url + '?varName=' + urlVarname + '&value=' + value, true); /* THIS IS LINE 25 */ xmlhttp.send(); } onmousedown="ajax(document.getElementById('searchParamater').value, 'http://192.168.0.7/controllers/search_controller.php', document.getElementById('searchBy').value, 'ajaxBucket')"> This whole thing works fine in firefox but when i use prism 0.9, it malfunctions and i get the following error in the errors console: Warning: assignment to undeclared variable xmlhttp Source File: http://192.168.0.7/javascript/main.js Line: 12 Error: uncaught exception: [Exception... "Not enough arguments [nsIXMLHttpRequest.send]" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: http://192.168.0.7/javascript/main.js :: ajax :: line 25" data: no]

    Read the article

  • [Simple] Beginner AJAX script not working, stuck on opening XMLHttpRequest

    - by Julian H. Lam
    Hopefully, this question isn't too juvenile to ask - but here goes: I'm trying to learn AJAX, and I'm stuck on a simple content-fetch. Here is my code: request = getHTTPObject(); function useHttpResponse() { if (request.readyState == 4) { document.getElementById("p").innerHTML = request.responseText; } } function update_p() { request.open("GET",content.html,true); request.onreadystatechange = useHttpResponse; } getHTTPObject is correctly defined, and returns a proper XMLHttpObject. As you probably guessed from the excerpt, the element I am trying to update is id'd "p". It calls the script correctly when a button is clicked, no problem there. The script seems to stop at line 8, at request.open. There's no error, and the script silently ignores anything afterward. I don't think I've missed anything, but of course, I probably did. Where did I go wrong? Thanks!

    Read the article

  • How does Gmail do comet on Opera?

    - by Unknown
    I would like to know how Gmail (or anyone else) does comet on Opera. Here is what I know so far from my experiments. It doesn't use the event-source tag which is broken in Opera 10.51. It doesn't use iframe which displays a spinning throbber and a busy mouse cursor. It doesn't use responseText on xmlhttprequest when readyState = 3 which is known to be broken on Opera. I tried seeing how it was done in mibbit and etherpad, and I found that they both use long-polling.

    Read the article

  • when i click on checkbox ,the image should be hiden though i dont make it happen somehow and i can g

    - by user309381
    function Psend() { new Ajax.Request('Handler.ashx', { method: 'get', onSuccess: function(transport) { var response = transport.responseText || "no response text"; //alert("Success! \n\n" + response); var obj = response.evalJSON(true); for (i = 0; i < 4; i++) { DeCheBX = $('MyDiv').insert(new Element('input', { 'type': 'checkbox', 'id': "Img" + obj[i].Nam, 'value': obj[i].IM, 'onClick': 'SayHi(this,i)' })); document.body.appendChild(DeCheBX); DeImg = $('MyDiv').insert(new Element('img', { 'id': "img" + obj[i].Nam, 'src': obj[i].IM })); document.body.appendChild(DeImg); SayHi = function(x,i) { try { if ($(x).checked == true) { img = "img" + obj[i].Nam; alert(img); $('img').hide(); } } catch (e) { alert("error"); } }; } }, onFailure: function() { alert('Something went wrong...') } }); }

    Read the article

  • Pass dynamic data to mvc controller with AJAX

    - by Yustme
    How can I pass dynamic data with an AJAX call to an MVC Controller? Controller: public JsonResult ApplyFilters(dynamic filters){ return null; } The AJAX call: $(':checkbox').click(function (event) { var serviceIds = $('input[type="checkbox"]:checked').map(function () { return $(this).val(); }).toArray(); //alert(serviceIds); $.ajax({ type: 'GET', url: '/home/ApplyFilters', data: JSON.stringify({ name: serviceIds }), contentType: 'application/json', success: function (data) { alert("succeeded"); }, error: function (err, data) { alert("Error " + err.responseText); } }); //return false; }); Ideally would be that the filters would contain the serviceIds as a property For example like this: filters.ServiceIds. I got another filter for a date range and that one would be added like so: filters.DateRange. And server side get the filter as a dynamic object in the ApplyFilters()

    Read the article

  • codeigniter csrf protection with ajax

    - by Yarandi
    i have a small problem here which i cannot fix,This post goes through but the response returns a “500 internal server error” who to fix it? JS in view: function load(value) { var utype = value; if(utype>0) { new Ajax.Request('<?php echo base_url().'another/load';?>'+'/'+utype, { method:'post', onSuccess: function(transport){ var response = transport.responseText || "no response text"; if(response!="no response text") document.getElementById('prog_id').innerHTML = response; }, onFailure: function(){ alert('Something went wrong ...') } }); } error in firebug : An Error Was Encountered The action you have requested is not allowed. when i change CSRF protection to False in config file its work for me.but i want protect this request with CSRF enabled. after search in CI forum i found this this link codeigniter-csrf-protection-with-ajax but i cant solve by it.can any one help me?

    Read the article

  • why i am getting popup message when I am tryiing to update user.

    - by kumar
    I am getting Popup mesage something like You have chosen to open Update which is a:application/json From : http://localhost:1234 which ok cancel buttons.. I am using this code to run.. [HttpPost] public JsonResult MEdit(ExpenseBE e) { var cache = CacheFactory.GetCacheManager(); string F_ACTION = "U"; string F_DEBUG = "Y"; var excUpdateStatus = false; for (int i = 0; i <= cache.Count; i++) { var x = (ExpenseBE)cache.GetData("a" + i); if (x != null) { string Resolutioncode = e.Exception.ResolutionCode; string reasoncode = e.Exception.ReasonCode; string actioncode = e.Exception.ActionCode; e.Exception.ExceptionID = x.Exception.ExceptionID; e.Exception.ReasonCode = reasoncode; e.Exception.ReasonCode = Resolutioncode; e.Exception.ActionCode = actioncode; e.Exception.Sequence = x.Exception.Sequence; e.Exception.FollowupDate = x.Exception.FollowupDate; e.Exception.IOL = x.Exception.IOL; e.Exception.LastUpdateUser = User.Identity.Name.ToUpper().Remove(0, 4); excUpdateStatus = common.UpdateException(e.Exception, F_ACTION, F_DEBUG); } } return Json(excUpdateStatus.ToString()); } and my view is <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<NorthernTrust.ATP.iTool.Core.Business.Entities.Specialist.ExpenseBE>" %> <% using (Html.BeginForm("MEdit", "expense", FormMethod.Post)) { %> <%= Html.ValidationSummary(true)%> <fieldset class="clearfix" id="fieldset-exception"> <legend>Mass Edit Exception Information</legend> <div class="fiveper"> <label for="ExceptionStatus"> Status: <span> </span> </label> <label for="ResolutionCode"> Resolution: <span> <%=Html.DropDownListFor(model=>model.Exception.ResolutionCode,new SelectList(Model.LookupCodes["C_EXCPT_RESL"], "Key", "Value"))%> </span> </label> <label for="ReasonCode"> Reason: <span><%=Html.DropDownListFor(model => model.Exception.ReasonCode, new SelectList(Model.LookupCodes["C_EXCPT_RSN"], "Key", "Value"))%></span> </label> <label for="ExceptionStatus"> Action Taken: <span><%=Html.DropDownListFor(model => model.Exception.ActionCode, new SelectList(Model.LookupCodes["C_EXCPT_ACT"], "Key", "Value"))%></span> </label> </div> <div class="fiveper"> <label for="FollowupDate"> Follow-up: <span><input type="text" id="exc-flwup-" /></span> <%--<%=Html.EditorFor(model=>model.Exception.FollowupDate) %>--%> </label> <label for="IOL"> Inquiry #: <%=Html.TextBox("Inquiery", ViewData["inq"] ?? "")%> </label> <label>Comment</label> <span> <%=Html.TextArea("value") %> <%=Html.ValidationMessage("value")%> </span> </div> <br /> <br /> <div> <button id="btnSelect" class="button">Select All</button> <button id="btnCancel" class="button">Cancel</button> <input type="submit" class="button" value="Save" /> </div> </fieldset> <% } %> <script type="text/javascript"> $(document).ready(function() { $('#btnSelectAll').click(function() { function validate_excpt(formData, jqForm, options) { var form = jqForm[0]; } $('#btnSelect').click(function() { $('#input [type=checkbox]').attr('checked', 'checked'); }); // post-submit callback function showResponse(responseText, statusText, xhr, $form) { if ('success' == statusText) { $('#error-msg span:last').html('<strong>Update successful.</strong>'); } else { $('#error-msg span:last').html('<strong>Update failed.</strong> ' + responseText); } $('#error-msg').removeClass('hide'); } $('#exc').ajaxForm({ target: '#error-msg', beforeSubmit: validate_excpt, success: showResponse, dataType: 'json' }); $('.button').button(); }); $('.button').button(); $("input[id^='exc-flwup-']").datepicker({ duration: '', showTime: true, constrainInput: true, stepMinutes: 30, stepHours: 1, altTimeField: '', time24h: true, minDate: 0 }); $('#ui-timepicker-div').bgiframe(); }); </script> please correct me if i am doing somwhere wrong? thanks

    Read the article

  • $.ajax working with Firefox, not IE

    - by Isamtron
    Hello, I have a jQuery code to allow users to login using a lightbox (http://colorpowered.com/colorbox/) and immediately start downloading files, without being redirected or having the page reloaded. It's perfectly working in Firefox but Internet Explorer keeps showing the login box until I reload the page :( <? if (!$this->session->userdata('user_logged_in')): ?> <script type="text/javascript"> $(document).ready(function() { $('a[href^="/link/"]').click(function(event){ var status = $.ajax({ url: "/status", async: false }).responseText; if (status != 'USER_LOGGED_IN') { $.fn.colorbox({href:"/login"}); event.preventDefault(); } }); }); </script> <? endif ?> Your help would be greatly appreciated.

    Read the article

  • Ajax get throws a syntax error when ip is given instead of localhost

    - by Aruna
    Hi , i am working on cakephp. I have developed an application where i have used localhost in all ajax post and get.. like var ht = $.ajax({ type: "GET", url: "http://localhost/FormBuilder/index.php/forms/getInvitees/<?php echo $emailid;?>", async: false }).responseText; var myObject = eval('(' + ht + ')'); this thing works only when i put localhost . But when i change that to my Ip like http://111.11.11.11/FormBuilder/index.php/forms/getInvitees/", then i am getting a syntax error () in the line var myObject = eval('(' + ht + ')'); WHy it happens ?? Please give valuable suggestions in solving this.. Thank you

    Read the article

  • How do I dynamically load a js file using Prototype?

    - by domagoj412
    Hello, I am using prototype to load external js file (actually it is php file) dynamically. Like this: function UpdateJS(file) { var url = 'main_js.php?file='+file; var myAjax = new Ajax.Request( url, {method: 'get', onComplete: showResponseHeader} ); } function showResponseHeader (originalRequest) { $('jscode').innerHTML = originalRequest.responseText; } Container "jscode" is defined like this: <script type="text/javascript" id="jscode"></script> And it works! But if some different file is called, all the functions from previous one are preserved. And I don't want that. Anybody knows how to "unload" first js file when second one is called? (I also tried using Ajax.Updater function but the result is the same.) Update: It turns out that there is bigger problem: it only loads if function "UpdateJS" is in window.onload that is why it doesn't load anything else after that. So prototypes update it's maybe not such a good way for this...

    Read the article

  • Dynamic path in new.AjaxRequest with Rails

    - by Robbie
    Hello, I was wondering if there's anyway to get a 'dynamic path' into a .js file through Ruby on Rails. For example, I have the following: new Ajax.Request('/tokens/destroy/' + GRID_ID, {asynchronous:true, evalScripts:true, onComplete:function(request){load('26', 'table1', request.responseText)}, parameters:'token=' + dsrc.id + '&authenticity_token=' + encodeURIComponent(AUTH_TOKEN)}) The main URL is '/tokens/destroy/:id', however on my production server this app runs as a sub folder. So the URL for this ajax call needs to be '/qrpsdrail/tokens/destroy/:id' The URL this is being called from would be /grids/1 or /qrpsdrail/grids/1 I could, of course, do ../../path -- but that seems a bit hackish. It is also dependent on the routing never changing, which at this stage I can't guarantee. I'm just interested in seeing what other solutions there might be to this problem. Thanks in advance :)

    Read the article

  • Why can I not send more than one request?

    - by Doug
    function stateChanged(idname) { xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById(idname).value = xmlhttp.responseText; } } } function openSend(php,idname) { stateChanged(idname); xmlhttp.open("GET",php,true); xmlhttp.send(); } function showHint() { if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } openSend("time.php", "Time"); openSend("date1.php", "Date1"); openSend("date2.php", "Date2"); return; } These two say aborted (in Firebug) and doesn't return a value. Why is that? Is it because I can't send more than 1 request? openSend("time.php", "Time"); openSend("date1.php", "Date1"); If I can't, how could I achieve 3 requests with only one invocation?

    Read the article

  • using xmlHttpRequest.send() in java script

    - by harun123
    How to use xmlHttp Request.send()?...... My code in java script is as follows: str_xml+="<xml_to_be_submitted><request_xml><client_id>"+document.frmCallEntryAdd.cboCLIENT.options[document.frmCallEntryAdd.cboCLIENT.selectedIndex].value+"</client_id></request_xml></xml_to_be_submitted>"; var obj_http=new ActiveXObject("Microsoft.XMLHTTP"); var str_url="ClientModuleFetch.aspx"; var str_http_method="post"; obj_http.open(str_http_method,str_url,false); obj_http.SetRequestHeader("Content-Type","application/x-www-form-urlencoded"); obj_http.send(str_xml); var str_reply=obj_http.ResponseText; var xmlResponse = str_reply; var objXmlDOM=new ActiveXObject("Microsoft.XMLDOM"); Can any body tell what i had gone wrong?................

    Read the article

  • making ajax request to another server

    - by santhosh
    Hi, I had a ajax sample code from W3Schools, where If i request ajax call to remote server the request getting fails. function loadXMLDoc() { 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("myDiv").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","http://www.google.com",true); xmlhttp.send(); } How to solve this..?

    Read the article

  • Backbone.js - Getting JSON back from url

    - by Brian
    While trying to learn Backbone.js, I've been trying to grab the content of a JSON file using the following code: (function($){ var MyModel = Backbone.Model.extend(); var MyCollection = Backbone.Collection.extend({ model : MyModel, url: '/backbone/data.json', parse: function(response) { console.log(response); return response; } }); var stuff = new MyCollection; console.log(stuff.fetch()); console.log(stuff.toJSON()); })(jQuery) 'stuff.fetch()' returns the entire object (with the data I'm after in responseText), 'stuff.toJSON' returns nothing ([]), but the console in the parse method is returning exactly what I want (the json object of my data). I feel like I'm missing something obvious here, but I just can't seem to figure it out why I can't get the right data out. Could someone point me in the right direction or show me what I'm doing wrong here? Am I using a model for the wrong thing?

    Read the article

  • jquery update div as text input is modified

    - by Piero
    Hi, So I have this text input in a form, and I want to update a div as the user types text in the text input. <p><label for="movie_name">Film: </label> <input type="text" name="movie_name" class="required" onkeydown="changediv2(this.value)" /></p> <p><div id="ajax_update"></div></p> My js method: function changediv2(str) { $('#ajax_update').html(geturl('http://url/search/movie?query='+str)); } If I type in a browser http://url/search/movie?query=someString, I get some html displayed. But when I call it via this ajax call, nothing happens... My geturl method: function geturl(addr) { var r = $.ajax({ type: 'GET', url: addr, async: false }).responseText; return r; } I cannot see what is wrong in there... Please help me! :)

    Read the article

  • how to hide the image? how can i do ?

    - by user309381
    function Psend() { new Ajax.Request('Handler.ashx', { method: 'get', onSuccess: function(transport) { var response = transport.responseText || "no response text"; //alert("Success! \n\n" + response); var obj = response.evalJSON(true); for (i = 0; i < 4; i++) { DeCheBX = $('MyDiv').insert(new Element('input', { 'type': 'checkbox', 'id': "img" + obj[i].Nam, 'value': obj[i].IM, 'onClick': 'SayHi(this)' })); DeImg = $('MyDiv').insert(new Element('img', { 'id': "img" + obj[i].Nam, 'src': obj[i].IM, 'style': 'display = inline', 'onClick': 'Say(this)' })); document.body.appendChild(DeCheBX); document.body.appendChild(DeImg); } }, onFailure: function() { alert('Something went wrong...') } }); SayHi = function(x) { if ($(x).checked == true) { // $('id').hide(); **$('img'+i).style.visibility = "hidden";**// doesnt work } };

    Read the article

  • how to access method variables from within an anonomous function in javascript

    - by Hussain
    I'm writing a small ajax class for personal use. In the class, I have a "post" method for sending post requests. The post method has a callback parameter. In the onreadystatechange propperty, I need to call the callback method. Something like this: this.requestObject.onreadystatechange = function() { callback(this.responseText); } However, I can't access the callback variable from within the anonomous function. How can I bring the callback variable into the scope of the onreadystatechange anonomous function?

    Read the article

  • Permalink Ajax Issue Wordpress

    - by Soumya
    function AjaxRequest(section,divName) { var pageurl = fullPath+"/ajaxrequest.php?section="+section+"&divName="+divName; //alert(pageurl); var xmlhttp; 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(divName).innerHTML=''; document.getElementById(divName).innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET",pageurl,true); xmlhttp.send(); } I have a Code like that in wordpress which is calling a page using ajax. It is working fine when the page are coming in ID like ?page_id=37 but stop working when I am activating Permalink like /overview/ajaxpage. I am getting 404 pafe error on xmlhttp.readyState. Can any one help me to solve it. I know its a permalink Problem probably this code of ajax is not sufficient for transmuting Permalink.

    Read the article

  • jquery javascript error using $(...) selector

    - by waitinforatrain
    Hi, I'm migrating some old code to jquery: xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState == 4) { $("#" + ajaxArea).html (xmlHttp.responseText); $("#" + ajaxArea).attr('title', 'Login'); $("#" + ajaxArea).dialog({ height : 140, modal : true }); } }; where ajaxArea is the ID of a DIV in the HTML. The dialog bit is basically adapted from the jQuery example here: http://jqueryui.com/demos/dialog/#modal All of it works fine up until the last line. Firefox throws an error that simply says "$(" for that line. Anyone know what might be causing this?

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >