Jquery invalid regex flag r?

I am using codeignitor with jquery.

My JS is as follows:

$(document).ready(function() { var p = {}; $('#content').load(/mycontroller/myfunction,p,function(str){ }); }); 

This gave me the wrong regex flag r error in line 3. I'm not sure if this is a JS error, or a problem with mod_rewrite codeignitor.

Can someone please wipe some lights? Thanks in extended.

+4
source share
2 answers

the .load() function accepts the URL as a string.

 var p = {}; $('#content').load("/mycontroller/myfunction",p,function(str){ }); 
+4
source

You need quotes around the path:

 "/mycontroller/myfunction" 
+5
source

Source: https://habr.com/ru/post/1344316/


All Articles