Tag: dom

Load Amazon MP3 widget on the fly

I’m having a terribly frustrating time getting this to work. I want to dynamically load/update an amazon mp3 widget. Amazon provides two scripts to include in the intended target location of the widget (https://widgets.amazon.com/Widget-Source/). I want to replace the widget with a new widget on a click event. I have tried inserting the scripts as […]

How to add dynamic rows in html table?

This is my first post and I am new in PHP, i am trying to build a POS system using PHP, but i stuck in sales module. Problem is when I scan barcode of an item, it display in textbox where i have set focus, and when i click add item button but when i […]

Values for document.readyState in Android 2.3 browser?

I found out that once the document has loaded, then in the Android 2.3.5 browser, the value of document.readyState is “loaded” instead of the standard “interactive”. Where are the possible values of document.readyState documented for the Android 2.3 browser?

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; […]