Results 1 to 3 of 3

Thread: Ajax

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User Ghost Rider's Avatar
    Join Date: Oct:2005
    Location: Troian
    Posts: 673

  2. #2
    Bombera's Avatar
    Join Date: Jul:2001
    Location: 4EVA
    Posts: 13,833
    . jax. JavaScript, XMLHttpRequest XMLHTTP .
    :
    Code:
    function getRequestObject(){
    var req;
    	try{
    		req=new ActiveXObject("Msxml2.XMLHTTP");	
    	}
    	catch (e){
    		try{
    			req=new ActiveXObject("Microsoft.XMLHTTP");
    		}
    		catch (e2){
    			req=null;
    		}
    	}
    	if(!req && typeof XMLHttpRequest != "undefined")
    		req = new XMLHttpRequest();
    	return req;
    }
    
    function get_data(lnk,item_id){
     var id = lnk.id;
     var first_index = id.indexOf('#');
     var last_index = id.lastIndexOf('#');
     var field = id.substring(first_index+1,last_index);
     var table = id.substring(last_index+1);
     var req = null;
     
    	req = getRequest();
    	if( req != null){
    		req.open("GET","xml_request.php?table="+table+"&field="+field+((item_id)?('&item_id='+item_id):''),false);
    		req.setRequestHeader("Content-Type","text/plain");
    		req.send('');
    		var tgt = document.getElementById('span#'+field+'#'+table);
    		tgt.innerHTML = req.responseText;
     	}
     	else
    		alert("Cannot load data");
    }
    , , . . .

    , - onchange onblur, , .
    Last edited by Bombera; 10th March 2008 at 17:37.
    EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
    Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|

  3. #3
    Registered User Ghost Rider's Avatar
    Join Date: Oct:2005
    Location: Troian
    Posts: 673
    ,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |