Método basado en el parámetro de URL

I have code which I would like to execute based on all the pages in the root directory of http://www.mywebsite.com/post/

What method would I use to target the post portion of the url, that way no matter what comes after it the code executes?

mi codigo es:

var url = document.location.href;
if (url = 'http://www.mywebsite.com/post/') {
//do something
}

I figured it out and success!

Below is the solution:

var url = document.location.href;
if (url.indexOf("post") > 0) {
//do something
}

Ultimately I would like to use this url "http://www.mywebsite.com/post/" like a wildcard. How do I this?

preguntado el 30 de agosto de 11 a las 22:08

There is a limitation on number of days after that time period you can mark as accepted... post the answer and mark it as accepted after the holding time period has expired...+1 for solving it yourself ;) -

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.