Jump to content

String replace in javascript


mcmuney

Recommended Posts

There's this line of code within a .js file:

 

o.tweet_raw_text = o.retweet ? ('RT @'+o.retweeted_screen_name+' '+item.retweeted_status.text) : item.text+o.bird;

 

This line is referenced inside a javascript as "{tweet_raw_text}" that displays a tweet.

 

What I'd to do is use this php function inside the javascript: $str = preg_replace('/http:\/\/.*?$/i', '', $str);

 

Any help would be greatly appreciated.

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/259786-string-replace-in-javascript/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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