![]() |
Stuck with jQuery (post) and CI - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Stuck with jQuery (post) and CI (/showthread.php?tid=34186) |
Stuck with jQuery (post) and CI - El Forum - 09-22-2010 [eluser]smilie[/eluser] Hi all, I could really use some help here, been banging my head to the wall for past two days ![]() A really simple script: step2.php (views) Code: <input type="button" id="bagView">test</input> Code: class Test extends Controller Code: <?php That's all. Problem is that I do not receive string 'test' with jQuery post code ![]() If I open URL (http://core_igniter/index.php/test) in the browser it is working. When I click on the button to trigger JS, it does execute it - I can see it in Firefox (firebug). But then it says: "Data Loaded: " (without string test behind it). What the hell am I doing wrong here ![]() Thanks! Smilie Stuck with jQuery (post) and CI - El Forum - 09-22-2010 [eluser]smilie[/eluser] Hm... Ok, small addition: It does not work between 2 domain names; step2 is on server1; controller is on server2. I have placed controller on server1 as well - then it is working ![]() So, this looks like network / two servers issue? Any help is appreciated! ![]() Stuck with jQuery (post) and CI - El Forum - 09-22-2010 [eluser]smilie[/eluser] Another note, just found it on Google: jQuery does not allow cross domain queries. But this seems so 'useless' then and frankly I can not believe that this is the case. That would also mean that for example many of Google's own Ajax scripts would not work (maps, search - you name it). Where is the flaw in my logic here? ![]() Regards, Smilie Stuck with jQuery (post) and CI - El Forum - 09-22-2010 [eluser]smilie[/eluser] Well, I solved it like this: view (jQuery.post()) calls local controller, local controller fires up REST library which performs remote check and returns it to view. I also saw there are some other options to be able to do cross-domain Ajax calls, but those seem quite 'damaging' and not really trustworthy - so I will stick to this ![]() Regards, Smilie |