Ajax url for route
Permalink
Howdy all
I have, what i think, should be a simple problem.
On a click event i want to load some html data via ajax. I got a route registered and i'm calling it with this hardcoded url: "index.php/NullGrad/Portfolio/sliderInsertContent".
If i place the block on the homepage everything works fine
(called url is "http://localhost/test/index.php/NullGrad/Portfolio/sliderInsertContent").
But if i place the block on a subpage i get a 404 error
(called url is "http://localhost/test/index.php/index.php/NullGrad/Portfolio/sliderInsertContent"). As you can see index.php is contained two times in the called url.
What is the best way to get the url for a registered route in an ajax call?
Cheers
Markus
I have, what i think, should be a simple problem.
On a click event i want to load some html data via ajax. I got a route registered and i'm calling it with this hardcoded url: "index.php/NullGrad/Portfolio/sliderInsertContent".
If i place the block on the homepage everything works fine
(called url is "http://localhost/test/index.php/NullGrad/Portfolio/sliderInsertContent").
But if i place the block on a subpage i get a 404 error
(called url is "http://localhost/test/index.php/index.php/NullGrad/Portfolio/sliderInsertContent"). As you can see index.php is contained two times in the called url.
What is the best way to get the url for a registered route in an ajax call?
Cheers
Markus