Get the prarameter from URL by jquery

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Lphp
Forum Commoner
Posts: 74
Joined: Sun Jun 26, 2011 9:56 pm

Get the prarameter from URL by jquery

Post by Lphp »

I have link

Code: Select all

<a href="ajaxupdate.php?hit=1&reid=<?php echo $row['id']; ?>" id="tag" name="tag"> link one</a>
In jquery
I have
<script type="text/javascript" >
$(function() {
$(".like_button").click(function(){

var link = $(this).attr("href") ;

var com_data='tag='+link;
alert(com_data); I get what I want in here

$.ajax({
url: "ajaxt.php",
type: "GET",
data: com_data,
cache: false,
success: function(html){
$("#com_data").append(html);

$("#flash").hide();
}
});
in my ajaxt

Code: Select all

 $tag=htmlspecialchars($_GET['tag']); I only get the value hit lost the part reid , why?? :( 
	echo($tag);
Post Reply