Jump to content

Recommended Posts

Can anyone see a problem with this:

 

 

 

function templates(num)

{

var url = window.location.href;

var qparts = url.split("?");

var varname = "num_pgs";

var value = "";

 

if(qparts.length == 0)

{

return "";

}

var vars = qparts.split("&");

 

for(i=0; i<vars.length; i++;)

{

var parts = vars.split("=");

if(parts[0] == varname)

{

value = parts[1];

break;

}

}

 

if(num == value)

{

document.getElementById("templates").innerHTML = "";

}

}

 

Link to comment
https://forums.phpfreaks.com/topic/71085-solved-_get-in-javascript/
Share on other sites

if you just want to get the parameters in the url useing javascript there are plenty to find online

 

here is one that works

http://ilovethecode.com/Javascript/Javascript-Tutorials-How_To-Easy/Get_Query_String_Using_Javascript.shtml

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.