2012-01-04 76 views

回答

0

可以Ajax來挑DOM元素的值,或者您可以使用location.href與您要發送附加到URL的值。 例如:http://localhost/message/index.php?&message= $('#message')。val()

希望這會對您有所幫助!

0

而不是您目前使用的任何重定向,請將其修改爲Javascript重定向。嘗試改變你的鏈接,如:

<script type="text/javascript"> 
    function newLoc() { 
    var messages = "something"; //set up the messages variable 
    window.location = "sendmessage.php?messages=" + messages; 
    } 
</script> 

<a href="#" onclick="newLoc()">Click Here</a>