$('tr td:first-child').click(function() {
var value = $(this).text();
// $("#showgrid").load('/Product/List/Item/' + value);
$("#showgrid").load('<%= Url.Action("Item"开发者_运维技巧, "List") %>/' + n + "?q=" + value);
});
Can I use like this to execute List Item Action result?
What is the best way to send the value with the URL? the above commented URL working fyn for me is there any way other way to use this?
since the URL you'll be calling is static at page load <%= Url.Action("Item", "List") %>
won't actually get re-called when your js hits that section. The way you have it commented out should be fine.
Are you asking if this will work? You mean, you've not tried it yet?
Anyway, your idea should work, assuming the file itself is processed on the server. I mean, if this code is in some external js file, Url.Action("Item", "List") will never be executed. And if it's in jsp file (or whatever framework you use), it should be fine.
精彩评论