$.post()-VBForums
Results 1 to 12 of 12

Thread: $.post()

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2009
    Location
    sydney
    Posts
    211

    $.post()

    im using $.post() which returns html script into a dialog, it works on my dev machine local host server, but hangs on the remote server!! i dont understand why, since its the same js library source, any ideas ??

    1 more thing, i noticed that window.location.href doesnt work on IE, any equivalent function to navigate which work on all browsers

  2. #2
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,572

    Re: $.post()

    Is it the same browser ?

    Did you tried debugging it ? Using Google Chrome's "Javascript Console" or using "Firebug" for Firefox.


    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India

    Skills: PHP, MySQL, jQuery, VB.Net, VB6, Photoshop...

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Dec 2009
    Location
    sydney
    Posts
    211

    Re: $.post()

    yes,same browser and the debugger doesn't show any errors, plus would not fall over on the dev environment if there was any errors

  4. #4
    Frenzied Member
    Join Date
    Apr 2009
    Location
    CA, USA
    Posts
    1,504

    Re: $.post()

    Show your code.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Dec 2009
    Location
    sydney
    Posts
    211

    Re: $.post()

    Code:
    <script  type="text/javascript">
    
    $.post('admin/checkMultipleAccounts.php',{},
    		function(data){sCompanies=jQuery.trim(data); // returns a table containing companies
    			$('#dialog').attr('title','Select a company.').html(sCompanies)
    		           .dialog( 
    								{
    									buttons:{ 'Cancel':function(){ $(this).dialog('close');window.location.href="logout.php";}} ,
    									draggable:false,resizable:false,modal:true, 
    								}	
    							);
    						}
    				);
    
    
    
    </script>
    i did a direct url to checkMultipleAccounts.php and had no issues, and just for testing i put an alert() in the call back function,did not pop up what tells me it is hanging on the server side, i also tried .error() method, but this caused in error in js consol : error() is not a method

    im lost

  6. #6
    Frenzied Member
    Join Date
    Apr 2009
    Location
    CA, USA
    Posts
    1,504

    Re: $.post()

    Although it doesn't appear so in your code, are you trying to post to a page on a different domain?

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Dec 2009
    Location
    sydney
    Posts
    211

    Re: $.post()

    no, same domain

  8. #8
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,498

    Re: $.post()

    Have you tried checking the access/error logs for the web server on the remote server?
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

  9. #9
    Web developer Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    12,506

    Re: $.post()

    Quote Originally Posted by wiss.dev View Post
    yes,same browser and the debugger doesn't show any errors, plus would not fall over on the dev environment if there was any errors
    Not sure if this has anything to do with it but following on what akhileshbc said is it the same version of the browser?
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    Please consider giving me some rep points if I help you a lot.
    Links to my code examples can now be found on my website: My websites
    Please rate my post if you find it helpful!
    Technology is a dangerous thing in the hands of an idiot! I am that idiot.

  10. #10
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,833

    Re: $.post()

    If this error means that surely there is some error in getting data from the checkMultipleAccounts.php page.

    Did the Request hit the checkMultipleAccounts.php ,if you attach the debugger for the PHP ?

    Try this one check if you get any error

    Code:
    <script  type="text/javascript">
    
    
    $(document).ajaxError(function(e, xhr, settings, exception) {
    alert('error in: ' + settings.url + ' \n'+'error:\n' + xhr.responseText );
    }); 
    
    $.post('admin/checkMultipleAccounts.php',{},
    		function(data){sCompanies=jQuery.trim(data); // returns a table containing companies
    			$('#dialog').attr('title','Select a company.').html(sCompanies)
    		           .dialog( 
    								{
    									buttons:{ 'Cancel':function(){ $(this).dialog('close');window.location.href="logout.php";}} ,
    									draggable:false,resizable:false,modal:true, 
    								}	
    							);
    						}
    				);
    
    
    
    </script>
    Please mark you thread resolved using the Thread Tools as shown



    www.techreceipe.tk


  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Dec 2009
    Location
    sydney
    Posts
    211

    Re: $.post()

    popped a message box
    error in: admin/checkMultiplrCompanies.php
    error :
    so no error returned, and as i mentioned in previous post,if i url checkMultipleCompanies.php it displays the desired html with no errors, also it works like treat on the dev localHost using the same browser(google chrome)


  12. #12

    Thread Starter
    Addicted Member
    Join Date
    Dec 2009
    Location
    sydney
    Posts
    211

    Re: $.post()



    ok,, after hours knocking my head against the wall and out of desperation i renamed the file and guess what !! that fixed it
    makes no sens ............

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.