我想要的只是获取网站URL.不是从链接中获取的URL.在页面加载中,我需要能够获取网站的完整,当前URL并将其设置为变量以便随意使用.
我正在使用jQuery.如何获取当前URL的路径并将其分配给变量?
示例网址:
http://localhost/menuname.de?foo=bar&number=0
Run Code Online (Sandbox Code Playgroud) 我使用以下函数删除表中的行
//delete individual row
jQuery('.stdtable img.delete').click(function(){
var c = confirm('Continue delete?');
if(c) jQuery(this).parents('tr').fadeOut(function(){
jQuery(this).remove();
});
return false;
});
Run Code Online (Sandbox Code Playgroud)
此代码位于单独的js文件中,并且对所有页面都是通用的.现在我想添加一个Ajax操作,删除数据库中的行.但是根据我所在的页面,它必须调用不同的控制器.
示例:产品页面必须在ProductController中调用delete,ProductGroup页面必须在ProductGroupController中调用delete
怎么办呢?