cancel
Showing results for 
Search instead for 
Did you mean: 

Problems With AJAX?

hogsmill
Newbie
Posts: 8
Registered: ‎22-08-2007

Problems With AJAX?

Hi All,
Anybody else had problems running AJAX on sites on plus.net? My scirtpts all run fine and dandy on my own web server, and another service provider, but I get a JavaScript error 'Access Denied' (Code 0) if I run them on my webspace at Plus Net.
I'm assuming it's some sort of permissions on the files? Any ideas?
Cheers,
Steve Wells
w: http://hogsmill.com
e: info@hogsmill.com
17 REPLIES 17
MikeWhitehead
Grafter
Posts: 748
Registered: ‎19-08-2007

Re: Problems With AJAX?

Do you have a copy of the code available for the script that isn't working? If you could point me to it, I'll see if it works for me. If you want to test if its the permissions on the files, CHMOD them all to 777, that will give global read/write/execute on them and would rule out permissions if that doesn't work.
I've not tried any AJAX code in my PN space, so that's the best I can help without having the code Smiley
EDIT: Make sure you CHMOD the files back, else there will almost definately be trouble in the future.
hogsmill
Newbie
Posts: 8
Registered: ‎22-08-2007

Re: Problems With AJAX?

Cheers, Mike - I'll give it a go. I'll send over a test script later that I know works....
Cheers,
Steve
Peter_Vaughan
Community Veteran
Posts: 14,469
Registered: ‎30-07-2007

Re: Problems With AJAX?

Don't use 777 as that can break things on the ccgi. Use 750
MikeWhitehead
Grafter
Posts: 748
Registered: ‎19-08-2007

Re: Problems With AJAX?

Apologies, I should pay more attention :P. 755 on the directories and 750 on the scripts themselves.
hogsmill
Newbie
Posts: 8
Registered: ‎22-08-2007

Re: Problems With AJAX?

Hi Mike
Have you got a mail address I can send some code to? I've got a very simple AJAX application that demonstrates the problem...
Cheers,
Steve
P.S. If you want to keep your address off the forum, you can send it to cheyne_hill@yahoo.co.uk
hogsmill
Newbie
Posts: 8
Registered: ‎22-08-2007

Re: Problems With AJAX?

Cheers for that - yes I sent it 'off-line'.
Still no further on with the issue, tho' - surely somebody must be running AJAX on Plus Net?
Cheers,
Steve
benoh
Grafter
Posts: 272
Thanks: 1
Registered: ‎24-08-2007

Re: Problems With AJAX?

Erm, how do you 'run' AJAX?Huh
AJAX isnt a programming language that runs on the servers, its a technique for client-server communications using javascript and XML.....I take it your using PHP for the site as thats all that PN offer.
Your javascript simply talks back to your php site
there is no running of AJAX to have a problem with
astarsolutions
Grafter
Posts: 393
Registered: ‎26-07-2007

Re: Problems With AJAX?

Quote
Erm, how do you 'run' AJAX?Huh

That's what I was thinking
MikeWhitehead
Grafter
Posts: 748
Registered: ‎19-08-2007

Re: Problems With AJAX?

He means "running AJAX code", surely you caught onto that? ???. I haven't had a chance yet to try out the code Steve sent me over but I'll post here once I find anything (when I can try it on my end).
astarsolutions
Grafter
Posts: 393
Registered: ‎26-07-2007

Re: Problems With AJAX?

Quote
He means "running AJAX code"

Well obviously.
I just find it strange how the term AJAX has come about and how people refer to it as they would a programing language.
hogsmill
Newbie
Posts: 8
Registered: ‎22-08-2007

Re: Problems With AJAX?

Quote from: astarsolutions
Quote
He means "running AJAX code"

Well obviously.
I just find it strange how the term AJAX has come about and how people refer to it as they would a programing language.

Yes, guilty as charged - very sloppy with my terminology. I really just mean xmlHttp requests from JavaScript, so I should really call it AJA, maybe  Wink I agree - AJAX is a technique, not a programming language. I think the 'X' is also very misused when people talk about AJAX - unless your using xmlResponse, there's no 'X' - if you use the textResponse, surely it's AJAT?  Cheesy
Anyway, I'm rambling. I've actually now sussed out the problem. It's to do with cross-domain xmlHttp requests (which are not allowed due to browser security). So, I will need to put a (PHP, probably) proxy in between my xmlHttp request and the web server. All a bit scary.
However, if I can get this to work, it opens up a fantastic new architecture where you can populate bits of web sites by making URL calls to various web sites for the info. Thus, you can componentise (is that a word?) a number of web sites with an element that runs off one script. Update the script, and every site gets the latest version of the component. Cool huh? If anyone's interested in this (unlikley, I know...), I can give some more detail/examples...
I've got it working as a desktop application (you can xmlHttp to any site from the desktop), but need the proxy to allow it on web sites.
Cheers,
Steve
pberry
Grafter
Posts: 40
Registered: ‎10-04-2007

Re: Problems With AJAX?

I can confirm AJAX techniques do work for PlusNet-hosted scripts.
You just have to make sure you've got your MySQL and CCGI account set up correctly, that you're using the correct connection details for each, and file permissions are correct for each.
At first that might seem a bit daunting, but once set up you get used to it.
Try http://ccgi.pberry.plus.com/ajax/ajax_test.html
Penny
Superuser
Superuser
Posts: 979
Thanks: 524
Fixes: 5
Registered: ‎05-04-2007

Re: Problems With AJAX?

Quote from: hogsmill
... if I can get this to work, it opens up a fantastic new architecture where you can populate bits of web sites by making URL calls to various web sites for the info. Thus, you can componentise (is that a word?) a number of web sites with an element that runs off one script. Update the script, and every site gets the latest version of the component. Cool huh? If anyone's interested in this (unlikley, I know...), I can give some more detail/examples...

There is an application within the site I build where this type of function might be very useful.  My grasp of php/mysql is fairly rudimentary (I've just learned the absolute basics to enable doing what has been essential) but the terminology of php/mysql "help sites" and tutorials is largely beyond me.
When you've figured all this out and got it working, I'd be interested in seeing the (full) coding as it might enable me to track back and isolate individual elements of the process that might be usable within what I'm putting together currently.
If that's okay Smiley
Regards.
Penny.
Penny Rollo * Force 9 from 17/02/98 * PlusNet from 2000 onwards
Project HappyChild - free maths worksheets, free French-English
worksheets and 12 other languages
personal site www.pennymidasrollo.plus.com
hogsmill
Newbie
Posts: 8
Registered: ‎22-08-2007

Re: Problems With AJAX?

Hi Penny,
Yes, got it all working fine, and be glad to show you the steps.
However, it still doesn't work cross-domain (i.e. making an AJAX call from hogsmill.com to (say) misterdoo,.com), due to browser security (nothing to do wth Plus Net, or any other ISP!), which is my holy grail. I'm still investigating how to do this, and I'l post soemthing when I've found a solution that is a) secure and b) sensible
I'd be interested to hear what your application is - it may not need AJAX, and I can certainly give some pointers to some other methods...
Cheers
Steve
http://hogsmill.com