JS isn't my usual language, but I'm venturing out to write a Chrome extension. This extension basically just injects a script on a page, so it behaves just like any other JS.Anyway, the script finds specific URLs on a specific page, and changes them slightly. I'm using regex to find these URLs. I've got one working, but I need another, and I can't figure it out.The first is this:Also, my skills with regex are miserable, so if you know of any way to make this better, I'm all ears. This matches URLs like this:Now I'm trying to match URLs like this:[URL]If you know how to modify the original regex so that it'll match the second kind of URL (but not the first)
I need some help creating some regular expressions that remove specific html tags...the script/expression will run when a button is clicked (i.e. "Remove Bold" button will remove <b> </b>).
currently I have these expressions working but they do not accomplish what exactly what I am after...Actually the functionality I'm looking for will incorperate both, however I can't seem to get it to work properly...
data.replace(/<[^>]+>/ig,"")+""); - this removes all tags (no matter what kind), I would like it to be a little less "greedy" and only remove specific tags. i.e: Input = <u><b>THIS IS SOME DATA</b></u> Output= THIS IS SOME DATA
data.replace(/<(B|b)[^>]*>[^<]*(</B>|</b>)/ig,"")+""); - this removes bold tags and will leave other tags like <u> behind, exactly what I was looking for. However, it also removes the content/data that is wrapped in the tag. i.e: Input = <u><b>THIS IS SOME DATA</b></u> Output= <u></u>
In the above example what I would like to happen is: Input = <b><u>THIS IS SOME DATA</u></b> Output= <u>THIS IS SOME DATA</u>
how to make the image a hyperlink to specific urls rather than the image in its own page in the contenflow.js? I've found that if you comment out this line: window.location.href=A You will successfully delete the hyperlinks that link to the full size image. However, I'd like to have a click on each image take you to individual specific pages. PS> I'm a designer not a javascript coder -- so detailed explanations are needed. Documentation: [URL]
I have: <div class="date">21-Mar-11</div> I would like to select only the 21 and then only the "Mar" and replace the content of the div with "Mar 21," or something along those lines. The output is not the problem. I need selecting specific parts of the string. So I want to learn more about selecting specific parts of strings.
I have the following scenario(well the structure is the same): <fieldset id="fs"><p><select id="sl" runat="server" /></p></fieldset> The name of the fieldset is constant but the name of the select is generated via asp.net thus i do not know the final id on that element. I can call on the select by using $("[id$='sl']").change() which works. But its a bad solution because I need to be sure that I only trigger the element under the fieldset "fs". $("#fs").children().change() Works as well but i obviously I am looking for a way to target only that select element under only that fieldset.
Apparently, this is for use of when you are modifying, for example, a PHP header or footer displayed on every page and you only want something to show up on particular pages. My issue is that I am trying to put something in the header of a Tumblr blog, and I only want it to show on the post pages.
I'm working on a project that has a logout button, but (like most things) it's kind of a hack. I'd really like the one logout window to actually hit two logout URLs. I only need to display one window that a person has logged out, but would like to end the session in both. I'm thinking I could use something like Code:
I have URLs as follows. [URL] I need a function which can retrieve substring from the above URLs. The substring should be upto the 2nd occurence of '/' as follows. [URL]
I have a database of URls' anf my web app calculates the loadtime of all this url one at a time and stores it in database,the way i am doing this is executing a javascript on onload event of iframe ,i want to calculate the cpu utilization of the sites as well and store it in database and have no clue to do this ,i can execute a system command like top but i can seem how to execute it in javscript,
assist with how to modify a specific css value of an object? For example, I want to do over all children of "body", and see if they have any css attributes containing a url(xxxxx) part. If so, I would like to make some change to that url (replace it with something else).
Im trying to parse an XML file that has holds the URLs to about 10 images. However, all the tutorials I have followed do not seem to work. Ive been trying this for a few days now and I was hoping one of your jQuery gurus may see something I dont.
I have a function which has two URLs that need to be posted via php onto a database. I had them as individual functions and they work fine but ideally I would like them to be done in the same function. For example, like the following... if (request !== null){ request.onreadystatechange = loginsuccess; //function to check RS=4 & Status = 200. request.open("GET", urllogonsubmit, urlrecieveemail,true); request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); request.send(null); }
I want to run some 100 urls on chrome with out exiting and also with out any tabs i.e on same window it should load urls one after another. I have written a script which will load urls in inframe. But how can i do it to load from address bar.
Is it possible to create URLs from function call operators?
For example, I'm trying to program an onClick function which will load a webpage in one frame and an image in another, based on the name of the button which is being clicked. So clicking the button with name="help" will open "webpages/help_page1.html" in one frame, and "images/help.jpg" in another.
To do this I was hoping that the following would work, where the function had been called by
function activate(buttonName) { webpageURL="webpages/"+buttonName+"_page1.html" imageURL="images/"+buttonName+".jpg" parent.frame1.location.href=webpageURL parent.frame2.picture.src=imageURL }
But this doesn't work, because the browser (IE6) looks for "webpages[object]_page1.html" and "images[object].jpg".
I am trying to create a form which when the submit button is selected will open a new window with 1 of 4 URLs based on the the combination of data in 2 select boxes.
For example:
if select box 1 = a and select box 2 = a then open new window with URL 1 if select box 1 = a and select box 2 = b then open new window with URL 2 if select box 1 = b and select box 2 = a then open new window with URL 3 if select box 1 = b and select box 2 = b then open new window with URL 4
I have a menu that is supposed to spin when a link is clicked on and THEN open the link. The onclick function runs nearly simulatenously as the link load, so I'm turning off the default behaviour ("return false") and loading the URL with the function; however this is where the error comes in. I gather from a bunch of google searches that I have escape some characters in the URL, but they are being passed in a variable (this.href), so I don't know how to do this.
Any way to update URLs on a page depending on the region selected by the user. I have 3 regions, Americas, Europe & Asia. And depending on the region selected I need to update URLs on the page for the different regions.
For example, below are the 3 possibilities for the links. domain.com/americas/product.php domain.com/asia/product.php domain.com/europe/product.php
I'm developing a site where the client needs a drop down nav <ul> menu. I'm using jquery to do this and it all works just fine except for the actual href aspect. The drop menu animation is functioning perfectly, but when the actual links are clicked on, the target url doesn't load. Just trying to get the links to function.
Here's the test url. The only two pages I have live are index.php and scp.php so we'll have to conduct our test by clicking back and forth between those.
[URL]
The code from my jquery config script file is below:
// drop down menu functionality $(document).ready(function(){ $( '#menu > li > ul' ) .hide()
What is happening is $(this) is no longer based on .expand being the (this) that is clicked.
like if i have a button SOMEWHERE randomly on the page with this
<div onclick="Minimize('_alerts');">Click Here</div> this will minimize alerts but because the (this) in minimize function doesn't actually point to the right button that I want to add a class to.
Is there a way to modify the minimize function so that it finds the <div id="mytoggle"><ul> <li class="expand boxminimize" rel="_alerts"> using the rel toggle, and then changes the class of the li from expand boxminimize to boxexpanded??
just like the .expand click function I posted on the top of the post that works?
Another thing that has been driving me crazy is that css positioning is handled differently by different browsers. JS is not my area, but I can do a lot with CSS, and I do, but cross browser compatibility is killing me.
I can use an IF IE statement and only IE runs that segment of code, but I haven't been able to figure out out how to make ONLY firefox or ONLY opera or safari enact an encapsulated segment of code. The same type of IF statement doesn't work for them.
Is there a single method using JS that works for all browsers?
I have a form with a search field that I want to search two different databases depending on which radio button is selected. Below is the form I have for searching our library's online catalog. What I'd like to do is add a radio button to this form which would enable the same search box to search WorldCat, which has a different URL
function result(){ var result = document.getElementById('resss').innerHTML; }
But what I actually want is to import data from a table of an external website. E.g. I want to get the innerHTML of a specific cell in column 3 and row 2 of a specific site.