ajax -> "page not found"
Permalink
Hello,
i am experimenting with ajax to fill a div with content from an other php file after pressing a submit button. It works when i test this outside of C5 but when i apply the code into a single page i created my div is filled with a C5 "page not found" message.
Probably something small (lack of C5 knowledge) ?
thanks
Marco
i am experimenting with ajax to fill a div with content from an other php file after pressing a submit button. It works when i test this outside of C5 but when i apply the code into a single page i created my div is filled with a C5 "page not found" message.
Probably something small (lack of C5 knowledge) ?
thanks
Marco
Thanks for your reply,
the other page is not a single page it's just a php page that generates content that should be send back to my single page.
i've been trying to read some more about using ajax in C5 but i'm not getting very far.
for example i have no idea what <?=View::... you suggest means
could you point me to doc's that help me understand this
generates a button that activates javascript
btw i'm not building a package (or should i be)?
thanks
Gr
Marco
the other page is not a single page it's just a php page that generates content that should be send back to my single page.
i've been trying to read some more about using ajax in C5 but i'm not getting very far.
for example i have no idea what <?=View::... you suggest means
could you point me to doc's that help me understand this
generates a button that activates javascript
<script type="text/javascript"> function toonCategorieen(categorieId) { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) {
Viewing 15 lines of 22 lines. View entire code block.
btw i'm not building a package (or should i be)?
thanks
Gr
Marco
Ok
i placed my php file that was supposed to give the feedback in a relative path, but the reference is made to the root, thats why my page returned a page not found
oeps
edit
it worked only with cID urls
edit
gr
Marco
i placed my php file that was supposed to give the feedback in a relative path, but the reference is made to the root, thats why my page returned a page not found
oeps
edit
it worked only with cID urls
edit
gr
Marco
Ok,
i'v started reading the developers doc from the start (learn to walk before you want to run)
on the cheat sheet i've stumbled on the solution to my problem.
when i paste this code in my xmlhttp.open code everything works.
Probably will learn a lot more if i keep on reading
gr Marco
i'v started reading the developers doc from the start (learn to walk before you want to run)
on the cheat sheet i've stumbled on the solution to my problem.
when i paste this code in my xmlhttp.open code everything works.
<?php print DIR_REL; ?>
xmlhttp.open("GET","<?php print DIR_REL; ?>/single_pages/inc/getProductCategories3.php?categorieParent="+categorieId,true);
Probably will learn a lot more if i keep on reading
gr Marco
<?=View::url('mypage','my_ajax_method') ?>
... or you can add another file specifically for that purpose. if you want to go with the later, then create another folder in your package called tools, and a file within that called "services.php" or something. then you'd access that with a url that looks like:
(in your case this might be what you need)
<?=View::url('/packages/packagename/services/?') ?>