开发者

problem in load() function

开发者 https://www.devze.com 2023-03-17 19:45 出处:网络
I\'m facing a problem with load() function of jQuery. Here is my code: $(\"#addButton\").click(function(){

I'm facing a problem with load() function of jQuery.

Here is my code:

$("#addButton").click(function(){
    var textbox1 = $("#textbox1").val();
    alert(textbox1);
    $("#stage").load('/poll_view3.php', {"textbox1":textbox1} );
});

Where addButton is the id of a button and textbox1 is the id of a text box.

I am working on CodeIgniter so when I call a view file containing this jQuery script it shows the button and text box too but when I click the button my another view poll_view3 should be loaded inside a div tags with id "stage" as mentioned above but poll_view3 is not loaded.

Pl开发者_如何学Goease help me out solving this, thanks.


 $("#stage").load('/poll_view3.php', {"textbox1":textbox1} );

i thought in this line you entered wrong URL make it write here

 $("#stage").load('../poll_view3.php', {"textbox1":textbox1} );

and if doesn't works then you can use jQuery.ajax() function for this

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号