Jump to content

String replacement with embedded script tags


Mahngiel
 Share

Recommended Posts

JSFiddle >> http://jsfiddle.net/Mahngiel/gfjfv/

 

I'm writing a plugin for a multi-lang app, where certain list elements are translated.  Accordingly these elements are written into the element with document.write(Var).  Now, in the same list element, there is a number pertaining to said var wrapped in parenthesis that i'm trying to remove.  Examples:

 

All: (10)

White: (3)

et al

 

My hack regex-fu works for elements that are not language-driven, but when it comes to the ones with embedded script tags, the entire page is being replaced.  I understand why this is happening, but I need a viable solution.

 

Any help appreciated!

Link to comment
Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

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.

 Share

×
×
  • 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.