Welcome To Snipplr
Everyone's Recent Snippets Tagged DOM
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Use PHP's DOM parser to convert a table into plain text (including links with images)
0
1690
posted 9 years ago by nigelnquande
For side by side ULs that become too wide on small screens/devices.
The following script let you merge or unmerge ULs depending on the size of the screen/device.
Works with jQuery
0
892
posted 11 years ago by jbernus
The use of dynamic data acquisition on modern web sites and in a lot of intranet applications, sometimes means we have to build structures dynamically as data comes in from a feed or AJAX operations. The problem is not with the data, but rather that...
0
825
posted 11 years ago by COBOLdinosaur
in jquery mobile, .html() not refresh DOM. Execute this function after any DOM change.
0
1117
posted 11 years ago by goo
Here’s a very simple script which adds numbers sequentially to an unordered list using jQuery
0
831
posted 12 years ago by satie83
Navigating the DOM in jQuery is incredibly simple and thats to phpQuery you can do the same in php. Below are some examples of how it's used, the key change bing that instead of $() you use pq(), and instead of a . you used ->. Theres alot more detai...
0
1017
posted 12 years ago by FatFolderDesigner
The Google Closure lets you get DOM elements with getElement( id ) and getElementByClass( class ). This function combines the two to let you get elements similarly to the way jQuery does. E.g. getElement( '#home .sidebar #links') returns the elemen...
0
1092
posted 12 years ago by cjcenizal
Open PHP file and enter User Credentials for localhost. The default dates are set to negotiate the 2011 season, but change the date variables to match your desired season data. The start date should be the day before opening day, and the end date t...
0
895
posted 12 years ago by wa-rufio
Simple recursive function to find objects that match the value of str hanging anywhere off the global JS object (window).
0
865
posted 13 years ago by richt
Check if user has intruded a real email address. Return true (real email) or false (fake email).
Arguments: Element from a form.
From book Dom Scripting by Jeremy Keith
0
1132
posted 13 years ago by alberomo
Arguments: Element from a form.
Take that element and checks if is filled. If not, returns false. If is filled, returns true.
From book Dom Scripting by Jeremy Keith
0
1116
posted 13 years ago by alberomo
A JS function that put the focus in the form field associated to a label element whenever is clicked. The for atributte of the label element must match the id attribute of the associated form field.
It takes no arguments.
From book Dom Scripting by...
0
665
posted 13 years ago by alberomo
JavaScript
accessing the DOM of a page loaded in an iframe [javascript] [dom] [iframe] [for-twitter]
0
1168
posted 13 years ago by Thammas
When injecting via jQuery HTML content which contains script tags referencing external scripts, which are then referenced via scripting elsewhere in the injected HTML, some browsers (Chrome) will not wait for the external scripts to load causing the...
2
1094
posted 14 years ago by harikaram
This snippet of code is probably the most common and _valuable_ in the world of jQuery.
1
898
posted 14 years ago by creativeboulder
Thankfully, Sjoerd Visscher mentioned an interesting technique that could be used to force IE to use the specified CSS styling. Specifically, once you create a new DOM element (of the same name as the one in the document) all styling is applied. [.....
0
831
posted 14 years ago by stephcode
the LIBXML parameter is what this snippet is about. Also this is one way to retrieve XML without having a XML-declaration prepended <?xml>
1
874
posted 14 years ago by iroybot
Similar to [Get Elements by Class Name]( http://snipplr.com/view/1696/get-elements-by-class-name/), but with optional "tag" parameter. Performance is increased by first retrieving the desired tag if available.
0
769
posted 14 years ago by jasonseney
Code is to demonstrate the use of DocumentBuilder to parse the XML file. And retrieve the data from it.
1
992
posted 14 years ago by PravinChk
SimpleSelector is a small DOM selector object with support for the most used selectors. It's also the default selector for the jLim JavaScript framework.
Why use SimpleSelector?
- very small, less than 2kb minified
- easy to use with $$()
- no...
1
931
posted 14 years ago by freelancephp