javascript - How to add a variable to the URL on click? -



javascript - How to add a variable to the URL on click? -

i have delte link [delete] onclick should attach couple of variables url.

<a id="close-frame-course" href="action=#?delete_course&course_id=<?php echo $courseid[$count]; ?>"><div class="close-frame">x</div></a>

the current url example.com/dashboard.php?page=all

i add together action=delete_course&course_id=1 upon clicking on link. seems not right. can't values in js. help me prepare it?

add class in html code using id. have used abc example.

class="abc"

now in jquery code href value , utilize window.location redirection.

$(".abc").click(function(){ var txt = $(this).attr('href'); var url="example.com/dashboard.php?page=all" window.location = url+txt; });

hope help you..

javascript php

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -