Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

JosephDuffy

macrumors regular
Original poster
Jul 12, 2009
158
8
Great Britain
Hi,
I'm making a small Safari Extension using my limited Javascript knowledge, and have hit a snag.
I'd like to use the "Pop Up Button" in the settings bar, and get some information from it. I'm suing Javascript to change the URL, and would like for te user to be able to change it. I've got the code to change the URL, and I'm using:
Code:
event.target.browserWindow.activeTab.url = currentURL.replace(*part to replace*, "*part to replace with*");
*Part to replace* = Test1
*Part to replace with* = Test2
This would change "www.macrumours.com/?test1" to "www.macrumours.com/?test2"
I'd like the user to be able to change the part that will be replaced from the drop down list.
I hope this is clear.
Thanks,
Joseph Duffy
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.