I'm working on a greasemonkey script that requires me to append a tag before each instance of a tag with a specific class name. It works when there's no parent tags but when it goes into levels deep it doesn't work. So how can I use insertbefore?
Can't seem to make it work, I have seen many examples but they are all just for 1 div tag. When i trymore than one it doesn't work anymore.The first one works, if i have more than 1 then the other don't work.
using the following jquery $(document).ready(function(){ $("#toggle-text").click(function () { var divvalue= this.value;
Is it possible to trigger the action of a form with a submit button that's outside the form tags? If so, how should this example be rescripted to make the input tag work outside the form tags?
Adjust the CSS margins of the BODY element with the first slider. The yellow P (paragraph) element resizes to fit its smaller containing block, as I would expect.
Then, adjust the CSS border or padding of the BODY element with the second and third sliders. The P element does not resize, though its origin changes. Instead, it overflows its containing block.
Finally, adjust the margins again. The P element snaps back into its containing block.
As you can see from the source, this is jQuery 1.6.4 and jQueryUI 1.8 pulled from googleapis.com.
I really know nothing about how to code JavaScript (I know what it is and what it does) and I need a script to go in the head of my page and look for all <a> tags that have <img> tags inside of them and add a rel="lightbox" attribute to them.
I have a page which has a form and also one iframe in the same. there is a button on the parent form.when the button is clicked, i am submitting the iframe and parent both. forms are getting submitted. but when i do print_r for iframe values, it is blank
I have a page. In that page is an iframe, lets name it 'A'. inside A there is another iframe 'B'. there is a link on that page which on click opens a popup. In that pop up, there is actually a document upload facility. Now i want that after every upload (onSubmit), iframe A should refresh.
have done it many times but today its not working.
function validate() { (window.parent.opener.location.href)=(window.parent.opener.location.href); window.parent.opener.location.reload(true);// this is tried as well }
I have a web form that needs to be printed for signatures. Problem is the form is just a bit too big and always prints on two pages. Is there a meta tag that will tell the printer to print the document on one page...or is there a meta tag I can use to print at 80%?
I have a div which includes many others tags (a, input, any others links). How can I disable the whole div? I want to any of the included tags may not be enable.
I have some extensive animation going on in this script. I have all the behavior I want out of this script. A 3D carousel interface, each window in the carousel is a separate UI window. It uses active scrolling for navs and content...like (iphone).The problem is that I have optimized to my best and still cant gain any performance out of IE. It runs pretty fast in FF, and in Safari. I have reversed loops, I have vared all my Math, I have stripped equations, could do more I guess, and I have made attempts at preventing even bubbling. I have minimized the use of <img> tags as well. I have even cached most methods and use a constructor method to create new HTML elements.At this point I am starting to feel like I am getting into techniques and areas of JS I just don't understand well.Here is example of a method I would like to optimize:
this.anim = function () { var s = Math.sin(s3D.A * .01); var c = Math.cos(s3D.A * .01);[code]....
I'm tryng to make two boxes on my page always the same hight, no matter how much text is inside one of them.
So the boxes will always be the hight of the box with the most text.
you can see what I meen here:
[URL]
I would wan't the two boxes to be the hight of the one to the left with the most text.
At first I thought it could be done in css, but I was told that I needed javascript to do it. And I don't have so much experience with javascript, but I can try
what I'm trying to do is get text from between two tags, just like the title says. Now I know I can get that through the innerHTML property, but its just that, I don't want HTML, I want plain text. Consider the following example.
<span id="p-5641"> This is <strong>strong</strong> & you should really put <em>emphasis</em> on that <a href="#">anchor</a>.<br>Line broken </span>
Now, what I want is, to get the text from between these span tags. That can be done by refering the ID of the span & innerHTML but that would give HTML & I want to strip off the HTML from it, so that I'm left with plain text, like
This is strong & you should really put emphasis on that anchor. Line broken with <br> & <p> tags preserved.
I have a couple of DIV tags I am trying to display. I thought it would be real simple but it is not.
1) A div tag with nothing in it - it needs to fill out the screen with a background color. It only shows a small portion along the top in IE but seems to work in Firefox.
2) A div tag with an image in it. It goes over the top of the previuos one. I would like to it centered on the screen, but it doesn't. Code:
PHP has a function called nl2br() which takes all the newlines in a string and turns them into break tags <br>. I need to do the same in javascript. Is this about right? I'm not sure how one is supposed to reference invisible characters in Javascript strings. I took an example on the web and tried to modify it to my uses.
function nl2br_js(myString) { var regX = / /gi ;
s = new String(myString); s = s.replace(regX, "<br /> "); return s; }
After looking around quite a bit using Google, I still couldn't find out what the gi in the above example is for. What is it?
If using an onclick event handler to execute javascript when an anchor element is clicked on, what should the href attribute be? #? javascript:void(0)? Something else?
I would like to include extra "hidden" information in a generated HTML page that can be used by javascript functions.
I realise that most browsers seem to ignore any tags and attributes they don't understand, but from what I can tell the standards do not allow me to make up my own tags or attributes as they will fail validation.
is there any standard element name that can be used for such a purpose i.e. passes validation but never produces any output (and ideally allows nested elements to be rendered normally too)...
I have a page which has multiple span tags, I would like a javascript function that can look at each of these span tags for me. Depending on the what the user is doing there could be a different number of span tags so I don't want to hard code them.
I have documents that I want to automatically add additional meta tags to. The documents already have some meta tags and I want to keep them all together, so I want to add my new meta tags to the end of the existing ones... can someone help me out with a script to do this... example below.=
Does anyone know of a way to wrap custom tags around selected text using execCommand or otherwise?
I am developing a rich text editor for use in a web site and while there are a few decent ones already floating around I need to implement a few extra bits of functionality. Specifically tool tips. Idealy I'd like to wrap custom tags around selected text using execCommand. Ie "Selected Text" becomes: