www.webdeveloper.com
Results 1 to 2 of 2

Thread: Executing jQuery function on Javascript Ajax Success

Hybrid View

  1. #1
    Join Date
    Apr 2011
    Posts
    2

    Exclamation Executing jQuery function on Javascript Ajax Success

    I have a setup where when the user changes the item on the dropdown, the price is updated by ajax.

    I want the price to pulsate with jquery ui after the price is updated.

    How can I do this? Here's my javascript:

    Code:
    <script type="text/javascript">
    function getxmlHttpObj()
    {
    		var xmlHttp;
    		try
    		{
    			// Firefox, Opera 8.0+, Safari
    			xmlHttp=new XMLHttpRequest();
    		}
    		catch (e)
    		{
    			// Internet Explorer
    			try
    			{
    				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    			}
    			catch (e)
    			{
    				try
    				{
    					xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    				}
    				catch (e)
    				{
    					alert("Your browser does not support AJAX!");
    					return false;
    				}
    			}
    		}
    		return xmlHttp;
    }
    
    function getPrice(price,product_id,attr_arr)
    {
    		opt_id = document.getElementById("optionsid").value;
    
    		xmlHttpObj = getxmlHttpObj();
    
    		xmlHttpObj.onreadystatechange=function()
    		{
    			if(xmlHttpObj.readyState==4)
    			{
    				document.getElementById("display_price").innerHTML =  xmlHttpObj.responseText;
    			}
    		}
    		xmlHttpObj.open("GET","ajax_onchange_price.php?price="+price+"&option_id="+opt_id+"&product_id="+product_id+"&product_opt="+attr_arr,true);
    		xmlHttpObj.send();
    
    }
    </script>
    Thanks.

  2. #2
    Join Date
    Apr 2011
    Posts
    2
    bump

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles