function insert()
{
var linkElement = document.getElementById("BackButton");
var linkElementLnk = document.getElementById("BackButtonlnk");
var loc_array = document.location.href.split('/');
if (loc_array[loc_array.length-3] == "m")
{
linkElementLink.style.display = 'none';
}
else if (loc_array[loc_ar...
So, what happened to the DOM level 1?
For example there are DOM level 0 events like this
window.onload = func;
element.onclick = func;
and there's DOM level 2 (and now even level 3) events
element.addEventListener("click", func, false);
But no mention anywhere about DOM level 1 events? Was it like with Lesuire suit Larry 4 that g...
How to zoom content of a web page? Like for example on familyecho.com you can zoom in and zoom out. How do they do it?
...
I want to write an extension for Google chrome that detects snippets of source code on web pages and automatically copies them to the clipboard.
I'm new to javascript and jquery, so for the first step, I wanted to try a very simple case.
Using this site as an example:
http://www.swharden.com/blog/2010-03-05-realtime-fft-graph-of-audio-...
I'm doing some async file uploading with iframes, and I'm wondering if simply pruning the iframe from the DOM is enough to cancel an upload.
This discussion seems to imply that this a poor approach to the problem overall, but annoyingly the JS `expert' refuses to reveal his solution.
Anyway, removing the iframe works in Gecko + WebKit,...
I am trying to figure out what would be the jQuery equivalent to the following code:
var temp = $('#logoutFrame2').contents().find('html').html();
try {
var temp1 = document
.getElementById('logoutFrame2')
.contentWindow
.document
.getElementById('theCBO...
In this specific case, the element is a table row.
...
When I want to check if an element exists in a page. Are these 2 checks the same? Is there a better more compact way to check the existence. What if I want to check if the value==''. Can this be included in this check as well somehow.
...
Here is my code, maybe you will notice right away what I'm missing :
DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = domFactory.newDocumentBuilder();
Document doc = builder.parse(fileName));
XPathFactory fact...
Is it possible to call in a .js file synchronously and then use it immediately afterward?
<script type="text/javascript">
var head = document.getElementsByTagName('head').item(0);
var script = document.createElement('script');
script.setAttribute('type', 'text/javascript');
script.setAttribute('src', 'http://mysite/my.js...
We have a tool that allows people to add code to a dynamic page.
A bit of code (a widget) needs to be injected into the DOM, not hard coded into the html. I use jquery to do it. The problem is that it ends up redirecting the page...
I need to solve this.
Here is an example. Create a page with the following:
<script type="text/javascr...
Hey guys, I think I need a new set of eyes to help me look at my code which isn't working as what I've expected. Sorry for the relative ease of the question but I don't really code in Javascript. Anyways:
Basically what I'm trying to do is to get the image to change to an inversed version on mouse over. So far I'm only testing the image...
Is it possible, in either the jQuery API or the DOM, to check if an element exists on the page or not?
Consider these two variables:
var selected = $('span#mySpan');
var created = $('<span id="mySpan">Testing</span>');
Both will return a jQuery object containing a span element. Is there any way to tell that the first exists on the pa...
Hello,
I'm building a web app for Sign In / Registration etc, and do not want the page to have to refresh.
www.mysite.com
I know how to set a hash on the URL without refreshing the page:
location.hash
to give: www.mysite.com/#signin
But what I want: www.mysite.com/signin
Without the hash so it's SEO friendly. Also, once I set tha...
I want an array of all elements that have fixed position.
This is what I've got so far (mootools code)
$$('*').filter(function(aEl){ return aEl.getStyle('position')=='fixed' });
Is there a more direct way to do this?
...
what's the best way to force DIV to fill specified width?
I have the following code that generates and assign width to DIV:
function createLabel(str) {
var textDiv = document.createElement('div');
textDiv.style.width = '200px';
textDiv.style.display = 'inline';
textDiv.appendChild(document.createTextNode(...
Hi,
I want to extract last character of a string. In fact I should make clear with example. Following is the string from which i want to extract:
<spara h-align="right" bgcolor="none" type="verse" id="1" pnum="1">
<line>
<emphasis type="italic">Approaches to Teaching and Learning</emphasis>
</line>
</spara>
In the ...
Hello. I have a string big_html and I want to add it to some div. I have observed a performance difference in the following:
$('#some-div').append( big_html );
// takes about 100 ms
//create it first
var append_objs = $(big_html);
$('#some-div').append( append_objs );
//takes about 150 ms
Does anyone know why this happens ? Thank you...
I have a website on a free domain that has html mark-up added server side to produce web banners. This mark-up is placed above and below the main outer tag. Is it possible to have jQuery strip this out prior to the page rendering?
...
I'm working on a realtime media browsing/playback application that uses <video> objects in the browser for playback, when available.
I'm using a mix of straight javascript, and jQuery,
My concern is specifically with memory. The application never reloads in the window, and the user can watch many videos, so memory management becomes ...