Link to home
Start Free TrialLog in
Avatar of Stephen Forlance
Stephen Forlance

asked on

Simple jquery passing a parameter via a link

Hi all,
im new to jquery.

I have this window that opens a modal:

http://bit.ly/1nwlkVW


How can I I pass a variable to the page that is opened from the link, so for example it opens ajax.html?id=[variable]

in normal js I would have just included it in the function call, like openmodal(12), but not sure how to do it in jquery

Thanks,
SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Stephen Forlance
Stephen Forlance

ASKER

Hi Gary, but how do I set somevar within the link?
Just change somevar to whatever it should be.
I think I need to explain what Im trying to do.

On the HTML there would be multiple links, each with a different variable.
Normally in JS I would do something like

<a href=#" onclick="somefunction(12)">a</a>

So the function somefunction would receive the variable 12, which I could then use to call the correct page.

How can I do this with jquery?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial