http://stackoverflow.com/questions/16368728/function-called-multiple-times-in-codeigniter-controller |
[eluser]andrejmk[/eluser]
I have also asked this question on Stackoverflow. Here is the link to the question: http://stackoverflow.com/questions/16368...controller Any thoughts on what might be the problem?
[eluser]andrejmk[/eluser]
The title was supposed to be "Function called multiple times in Codeigniter controller", I posted the link by mistake in the title, and I can't edit it now...
[eluser]TheFuzzy0ne[/eluser]
Sorry, I don't understand. Is this resolved now? Your Stack Overflow post says it was due to a jQuery plugin.
[eluser]andrejmk[/eluser]
It's not resolved. The page works OK when I remove the plugin. The plugin only preloads images from the "images" folder. Why would it cause the function to be called three times? I don't know if something is wrong in my .htaccess
[eluser]TheFuzzy0ne[/eluser]
I have no idea, but I don't think it has anything to do with CodeIgniter. Try installing Firebug. That will allow you to see exactly what requests are being made to the server. If it's a problem with the jQuery plugin, there's not really much we can do.
[eluser]andrejmk[/eluser]
I've found what causes the error, but I don't know how to fix it If I call the page like this: /products/insert it works OK. But If I call it like this: /products/insert/ - the insert function is called three times. It's not causing me problems, because only the first time the form validation passes, but still... If I call /products/edit/1 it always calls the function three times. In config/routes.php I only have default route. My .htaccess is this: Code: RewriteEngine on
[eluser]TheFuzzy0ne[/eluser]
That's strange. Try this .htaccess file instead. Code: RewriteEngine On
[eluser]TheFuzzy0ne[/eluser]
Have you installed Firebug yet? At the very least, that should make it clear where the requests are coming from.
[eluser]andrejmk[/eluser]
Yes, I'm using Firebug, but it is not giving me any info. I asked another question on Stackoverflow: http://stackoverflow.com/questions/16484...iple-times It loads the function three times if I have parameter in the query: categories/edit/3 or slash at the end of /categories/insert/ The suggestion from Stackoverflow was that it is due to calling three views (because of the template). I guess this has nothing to do with my configuration... |
Welcome Guest, Not a member yet? Register Sign In |