Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    May 2006
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to connect javascript to PHP without ajax

    after I experienced some problem with my host is there any alternatives to ajax

    I want to hook some user events (like mouse click) to execute php function

    any idea ?

  • #2
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    A request needs to be made to the server. This can either be a standard GET/POST from a link/form submission, or something in the background. The latter method is known typically as AJAX, and can be achieved either with javascript's XMLHttpRequest (or an ActiveX equivalent...) or by loading a hidden iframe (you can probably tap into Flash some how as well...).
    Perhaps you could expand on 'Problems with your host'? There's nothing inherent to XMLHttpRequest (probably the most common way to achieve what it seems you want) that will cause server-side problems.

  • #3
    New Coder
    Join Date
    May 2006
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I upload my site to host company in UK and the site loading is slow and when I try the same site in USA host company the site runs ajax get method faster

    so I wish if there is a more standrad way to connect javascript to php I feel that ajax is not a new technology but a work around solution to somthing should be exists in web programming in the first place

    any way thanks

  • #4
    Senior Coder
    Join Date
    Jul 2005
    Location
    New York, NY
    Posts
    1,084
    Thanks
    4
    Thanked 19 Times in 19 Posts
    You latency is different based on your geography. The people using your site from the UK on your UK host will see it run faster.

    It's just the truth of the net.

    Anyway, like was said, if you're not gonna make requests using Javascript (AJAX) then you're going to have to submit forms like the way people used to do things.

    AJAX doesn't run fast or slow because of the host, it's the data pipe. Your page will load just as slowly (or slower) with normal form posts.


  •  

    Posting Permissions

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