Hello, I have been dealing with an odd problem that .click() events happen twice whenever placed in a jQuery Dialog.
My simple test case is below and a live example is here
<div id="popup" style="display: none">
<a href="javascript:void(0);" id="testlink">Test Link</a>
<script type="text/javascript">
$('#testlink').cli...
I'm loading image tags via AJAX and inserting them with the conventional .html(content) function in jQuery alongside a bunch of other HTML. However, this question still applies if you're loading a page from scratch. Now, I have a background image placeholder to be put there while the image loads. I want this background image to go away w...
I have been using PHP's DOM to load an html template, modify it and output it. Recently I discovered that self-closing (empty) tags don't include a closing slash, even though the template file did.
e.g.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"`"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equ...
Hi,
I want to pass a parameter to some javascript using a single line of code, like this:
<script language="JavaScript" src="courselist.js?subj=MATH" type="text/javascript" />
Inside the javascript file, how can I get the value of the parameter "subj"?
Thanks
...
I'm writing some javascript using jQuery to call a method on all nodes with class datepicker.
Here's what I have:
$('.datepicker').my_method();
This works as expected - it calls my_method.
However, I want to be able to call my_method on all new nodes that are inserted into the DOM with the class datepicker.
I want similar functiona...
Is there a way to get the innerHTML of a section of the page together with all style information that is used by the elements in that section(including styles that also come from corresponding stylesheets). So that when I insert the html somewhere else It will display with original styling.
...
Let's image that I have something like this:
<html>
...
<div>
<iframe src="test.html" hash="r4d5f7"></iframe>
<iframe src="test.html" hash="8f7x97"></iframe>
<iframe src="test.html" hash="gg4v5e"></iframe>
<iframe src="test.html" hash="e54f87"></iframe>
</div>
...
</html>
test.html is empty page...
Hi everyone,
As the title, how can I remove a div on the html title using javascript or jquery framework?
I know it sounds weird but currently I'm working on a CMS template and the generate title has around the title
<title><div id="title">Title of the page</div></title>
Any help appreciated
...
Hello all,
My name Rithy.
I don't know how to add new line before appending a new node or element in the xml.
My php:
$dom = new DOMDocument();
$dom->formatOutput = true;
$dom->preserveWhiteSpace = true;
$dom->load($xml_file);
$body = $dom->getElementsByTagName('body')->item(0);
$newelement_seg = $dom->createElement('seg');
$da...
Hi everyone!
I was making a page with frames. One is a treeview frame, the other is showing a report. When I click the item in the left frame, the report will display in the right frame. But after I click the first item, the location object in the right frame became unavailable! Which prevents me from opening a new report in the same f...
I have a set of html documents on local disk to process. I need to load each document file as document object and run a piece of javascript code over it and store the result in a separate file. I would prefer to this from python though I'm open to any other suggestions too. I tried to do this through extensions in chrome and firefox b...
The bookmarklet has the following code:
javascript:(function(){var%20a=window,b=document,c=encodeURIComponent,d=a.open("http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk="+c(b.location)+"&title="+c(b.title),"bkmk_popup","left="+((a.screenX||a.screenLeft)+10)+",top="+((a.screenY||a.screenTop)+10)+",height=420px,w...
I am currently working a developer tracker for a game without using regex. I have hit a road block when trying to parse html at certain parts.
What I am trying to parse:
<td class="alt1" id="td_post_139718">
<!-- message, attachments, sig -->
<!-- icon and title -->
<div class="smallfont">
<img class="in...
Is there a handy way to "touch" a DOM element? I'd like to remove the element and insert it again at the same position. Something like this:
element.parentNode.removeChild(element).appendChild(element);
except that appendChild inserts the element as the last sibling.
...
Is it possible to augment a DOM element by adding a new property to it as augmenting a normal JavaScript object? For example, can we add a new property of a button or an input, say a value that indicates when was the last time user click on it?
...
following is my code, can any one tell me whats going wrong.
<input type="checkbox" name="Chk[]" value="<?php echo($arr['id']); ?>" onClick="Click()" id="CK">// all checkboxex
<input onClick="selectall()" type="checkbox" value="yes" name="c1">// one checkbox
/*function called*/
function selectall()
{
if(document.frm.chk.val...
Hi all!
I have following structure of web application, for which I'm automating testing:
<em unselectable="on" class="x-btn-split">
<button type="button" class="x-btn-text " id="ext-gen523" title="Add Options">Add</button>
</em>
Both objects has event listeners,added viw JavaScript in some linked js-file (I don't know what f...
Is there a way to select the top most DOM element at a certain x-y position with Javascript?
So give x and y, what DOM element is there?
...
I am in search for an efficient method to replace a couple of DOM Elements - if possible in one action only.
It is needed for augmenting TextNodes. If a certain word is present, it shall be wrapped in span-Tags, to which an event handler needs to be assigned later.
so if a text Node contains the word it needs to turn from
-#textNode
...
Hello!
I have a form with a set of links and hidden inputs like this:
<div><%=link_to '↓', {}, {:href =>'#',
:onclick => "return moveDown(#{photo.id});"}%></div>
<%= photo_form.hidden_field :position %>
How do I change input value when link is clicked without hard-coding input ids on client side? i dont want to use selector...