|
Mailing Lists
|
Home /
Groups /
JQuery
Need to find/ replace() in an entire DOM
Author: Will Tomlinson
Short Link: http://www.houseoffusion.com/groups/jquery/thread.cfm/threadid:2055#6270
Hey,
I need to traverse an entire DOM, find a match for a pattern like this:
someController.somemapping
And I need to replace that text with this:
someController.somemapping&someURLVar=someValue
This pattern could be located ANYwhere in the document - a form action, an
onclick, etc.
Here's what I've built so far, but it doesn't work. Any ideas would be
appreciated:
$(document).ready(function() {
var regexp = /([a-zA-Z]+\.[a-zA-Z]+)/;
$(this).html().replace(regexp,$1 + "&someURLVar=someValue");
});
Thanks,
Will
|
May 25, 2013
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||