Pager:在 HTML_Ajax.replace 函数中传递附加参数

发布于 2024-11-07 10:41:53 字数 767 浏览 6 评论 0原文

抱歉,我的菜鸟问题

我正在使用一个简单的 mvc 模型,将数据放入数据存储中,并将数据库表名称 q 作为视图中的参数传递。

代码:

function showUser(str){ 
url = 'getuser.php?q='+ str ; 
HTML_AJAX.replace('txtHint', url); 

}

我正在使用以下寻呼机模块来显示页面。如何将附加表名称作为页面参数文件名中的参数传递?(请参阅下面的代码片段)。这样,单击页面链接就会显示所需的数据库集

代码:

$pager_params = array( 
'mode'     => 'Sliding', 
'append'   => false,  //don't append the GET parameters to the url 
'path'     => '', 
'fileName' => 'javascript:HTML_AJAX.replace(\'txtHint\',\'getuser.php?pageID=%     d\');',  //Pager replaces "%d" with the page number... 
'perPage'  => 10, //show 10 items per page 
'delta'    => 1, 
'itemData' => $Data 
); 

当前单击链接 pageid 会出现 SQL 错误,因为它没有传递表名称

Sorry for the noob question

I am using a simple mvc model of putting data in datastore and passing the database table name q as a argument from view.

Code:

function showUser(str){ 
url = 'getuser.php?q='+ str ; 
HTML_AJAX.replace('txtHint', url); 

}

I am using following pager mod to display pages. How can I pass additional table name as argument in the filename of the page params?(see the below snippet). So that clicking page links show me the required database set

Code:

$pager_params = array( 
'mode'     => 'Sliding', 
'append'   => false,  //don't append the GET parameters to the url 
'path'     => '', 
'fileName' => 'javascript:HTML_AJAX.replace(\'txtHint\',\'getuser.php?pageID=%     d\');',  //Pager replaces "%d" with the page number... 
'perPage'  => 10, //show 10 items per page 
'delta'    => 1, 
'itemData' => $Data 
); 

Currently clicking the link pageid gives me SQL error since it doesnt pass the table name

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

握住你手 2024-11-14 10:41:53

将评论转换为答案:


好的,我确实设法在文件名参数中传递附加参数,其中

 \'target\',\'&q=\' + <?php echo $data1 ?> + \'getuser.php?pageID=%d\'

$data1 是先前查询中已存储在表名中的参数。并更新函数,

url = 'getuser.php?q='+ str + '&pageID=%d'

但现在的问题是它不替换我正在被覆盖的单独查询的 div。这也可以通过将 append 参数更改为 true 来解决。

Converting the comment to an answer:


ok i did manage to pass the additional arguments in filename param as

 \'target\',\'&q=\' + <?php echo $data1 ?> + \'getuser.php?pageID=%d\'

where $data1 is the already stored in tablename from previous query. and updating the function as

url = 'getuser.php?q='+ str + '&pageID=%d'

but issue is now its not replacing the div i am getting overwritten separate query. This can be fixed with changing the append param to true as well.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文