Tag: dom

jquery append upper case tags

I want to append uppercase tags into dom object. while try like this, everything converted to lowercase. $dom = $(“<root/>”); $dom.append(“<LName>user10</LName>”); alert($dom.html()) //<lname>user10</lname> I saw one post in stackoverflow. They suggested to do like this. $dom.append($.parseXML(“<LName>user10</LName>”).documentElement); This works good in FF, Chrome and safari. But it is not working in IE… FIDDLE

<select> element and observe('click') on options to toggle option.selected

I’ve seen a few examples using jQuery that do what I want, but I’m developing a plugin for an application that uses the Prototype framework and would like to stick to that. Basically, I want the functionality as if the ctrl key was always pressed. If a selected option is clicked, I want it to […]

Adding a fallback image for a swf in IE8 and lower using createElement?

I’m creating a script that’s supposed to create an embedded SWF and also use a image as fallback if the user doesn’t have Flash available. Since I’m not allowed to use any other libraries like SWFobject I’m stuck using DOM-techniques like createElement/appendChild/setAttribute. I’ve been using this great blog post: http://pipwerks.com/2011/05/30/using-the-object-element-to-dynamically-embed-flash-swfs-in-internet-explorer/ as a guideline, and I […]

“Friendly iFrame” detection: How can I find my nested iframe in the top page?

I’ve come across a challenging iFrame detection problem in a “friendly iframe” environment. I need to identify from window.top which foreign domain iframe element in window.top.document loads inside of itself yet another iframe with the same domain, protocol, and port as window.top. So here’s the central question: On Page A, how can you determine in […]

When creating a web widget should i use data attributes on the container div or should i add parameters to the script?

I’m creating a web widget. So basically i load a script from a remote server and display content in a container div. I have the need to send extra parameters to the server, for example filter some contents or choose the display and so i have two options Pass the data in the script tag […]

Get a text from HTML using javascript

I am a beginner in JavaScript. I’m trying to understand how can I work with DOM in js… I would like to get a text from some website, from every DIV no matter how complex the structure is. If I run my code below it will give me the text but: patern div give me […]

How to Update URL for Dynamic URLs

ShareThis does not seem to have a way to update URL which dynamically changes for html5 history-enabled or ajax-driven sites. I tried this function to update it but URL remains original: function initShareThis(){ var el = document.getElementById(“lotShareThis”); var target = el.firstChild; for (var i in stWidget.shareables) { if (stWidget.shareables[i].element === target) { stWidget.shareables[i].url = window.location.href; […]

Memory Build Up In IE9

Possible Duplicate: Is Unhooking event handlers needed to avoid memory leaks in IE I’m having some trouble pin pointing the source of a memory build up in IE9. The memory usage jumps up by about 50Mb each page refresh. For example look at Nordstrom.com, each page refresh the memory jumps up quite a bit and […]

How to get text inside span, and use it into other script

let say.. <span id=”Singer”>Bieber</span> I know by using DOM I can duplicate ‘Bieber’ to anywhere.. <script> x=document.getElementById(“Singer”);document.write(“<span>” + x.innerHTML + “</span>”);</script> ..but id doesn’t seems working when I want to insert the DOM script into the script below. Is there any way to put ‘Bieber’ into the script below? <script language=JavaScript src=”http://lyricfind.rotator.hadj7.adjuggler.net/servlet/ajrotator/275968/0/vj?z=lyricfind&dim=35518&click=&kw=<I WANT TO PUT […]

Parent onclick() event not being called when child div is clicked

I have a situation where I have nested divs. I have a parent div (that has an onclick() event) and a few divs inside that are being dynamically populated. I’m given to understand that through ‘bubbling,’ the onclick() event should propagate up through the DOM, triggering the onclick() event in all parents. All of the […]