vignesh kamath
vignesh kamath

Reputation: 1

Redirecting to an URL based on parameter taken from an Event

I have a JavaScript where I pass an event as a parameter on a click of a button and the script has to take the respective Id of the event, which I would then use to redirect to another page. The Code is as follows:

function eventClick(e)
{ var Id = e.TaskId;
document.location='../Task/Assignedtask?taskId=' + Id;  
}   
Although it raise an alert with the TaskId of that respective Event, but it does not redirect to the page that is intended. I have tried href and window.location, still the alert window comes up with the taskId.

Upvotes: 0

Views: 36

Answers (1)

mandrakey
mandrakey

Reputation: 26

Try document.location.href - "href" being the part that seems to be missing in your code.

Upvotes: 1

Related Questions