I have the following function:
<script type="text/javascript">
function changeText(elem){
var oldHTML = document.getElementById(elem).innerHTML;
var newHTML = "<span style='color:red'>" + oldHTML + "</span>";
document.getElementById(elem).innerHTML = newHTML;
}
</script>
And the following HTML:
<table>
<tr>
<td id = "foo">bar...
Hi, I have the following HTML structure:
<div><a href="link1">blah</a></div>
<div><a href="link2">blah</a></div>
<div><a href="link3.swf">blah</a></div>
<div><a href="link4">blah</a></div>
<div><a href="link5.swf">blah</a></div>
<div><a href="link6.swf">blah</a></div>
Using jQuery I want to retrieve the links that contain the '.swf' e...
Hello,
I'm trying to do the following:
$string = "<object width=\"425\" height=\"350\">
<param name=\"movie\" value=\"http://www.youtube.com/v/1OtdDqF5rnI&autoplay=0\"></param>
<param name=\"wmode\" value=\"transparent\"></param>
<embed src=\"http://www.youtube.com/v/1OtdDqF5rnI...
Hello,
I wondering if it is possible to count the number of elements using jquery and then using that prefix the element with a number, so for example I have 2 selects on a page, is it possible to count the selects and then give the selects, a class e.g.,
<select class="1">
<select class="2">
...
I am writing a regex find/replace that will insert a <span> into every <a href> in a file where a <span> does not already exist. It will allow other tags to be in the <a href> like <img>, <b>, etc.
Currently I have this regex:
Find: (<a[^>]+?style=".*?color:#(\w{6}).*?".*?>)(.+?)(<\/a>)
Replace: '$1<span style="color:#$2;">$3</span>$4'
...
Hi,
Using jQuery, while in the span element, without knowing post-383 id and class, how can I retrieve the url within the h2 a element?
The html code:
<div id="post-1383" class="post-1383>
<h2 class="entry-title">
<a href="http://example.com/soul-music/">Soul Music</a>
</h2>
<span class="btn"></span>
</div>
Something like this?
$...
I'm trying to use JS to access data in OpenGraph meta tags. It works fine with meta tags that have the standard attributes (name="x" content="y"), but for OpenGraph tags, the meta tag reads
<meta property="x" content="y">
I haven't had any luck accessing the contents of the "property" attribute using JS. The .name attribute is just...
Hi,
The top answer to this question describes a technique to implement an efficient XSLT pipeline in Java:
http://stackoverflow.com/questions/1312406/efficient-xslt-pipeline-in-java-or-redirecting-results-to-sources
Unfortunately, while Transformer seems to expose an API for setting XSLT parameters, this does not seem to have any eff...
The best way to describe this issue is probably to show you an example:
css/right aligned, works fine when clicking the arrow both ways:
http://jsfiddle.net/JDhuK/1/
css/left aligned, only works properly when left arrow is used:
http://jsfiddle.net/3nqr4/
I've provided two javascript functions(leftTest and rightTest)that you will need...
Hello! My problem is that I'm using the CKEditor 3.4 plugin for jQuery, and it's giving me an error in IE 7+8 when executing a $(selector).val(html) call on the editor:
The error:
'this.$.innerHTML' is null or not an object
...which when run in the debugger, points to this line of code in the huge CKEditor.js:
getHtml:function(){var ...
Hello,
I'm dynamically inserting some html into the document (by using obj.innerHTML += 'some html'). In that html, there are images with 'imageId_X' ids (ie. imageId_1, imageId_2...). This works fine, but there's something wrong with the following code:
for (var n = 0; n < pConfig.images.length; n++)
{
document.getElem...
Hi There, I have some ajax on my web page, that is triggered via a click event, the javascript in question looks like this,
$('.career_select .selectitems').click(function(){
var selectedCareer = $(this).attr('id');
$.ajax({
type: 'POST',
url: '/roadmap/step_two',
data: 'career_choic...
I working with some ajax at the moment, the result of a successful ajax result is that some more content is add to the page on the fly. My problem is that is added on the fly it looks like I cannot attach any events to the elements that are added.
The flow of what happens is that the user selects an option from a dropdown list, the valu...
I'm writing a greasemonkey extension for a site which at some point modifies location.href.
How can I get an event (via window.addEventListener or so) when window.location.href changes on a page? I also need access to the DOM of the document pointing to the new/modified url.
I've seen other solutions which involves timeouts and polling...
I'm writing a GWT-Hibernate internal web application for our development group.
Previously, I had written tools to parse up XML files which represented customer configuration gathered in the field for analysis. Now, I'm trying to add an UI front-end for the support group. The XML parsing code uses xpath and org.w3c.dom classes to consum...
Sorry if this has been asked, I am not sure how to best word it so I couldn't find a result on Google.
I currently have a div #divForm with some text and a table that has a form inside. I currently have it so when you click on the div it toggles to show the table:
$("#divForm").live('click', function () {
$(this).attr('cla...
I originally asked a question along these lines using Regex but was recommended to use the PHP DOM library instead...which is superior, but I am still stuck.
Basically I want to wrap the contents of an <a> in a <span> if it is not already wrapped in <span>.
<?php
$input = <<<EOT
<html><head></head>
<body bgcolor="#393a36">
<a hre...
<html>
<head>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".pane:even").addClass("alt");
$(".pane .btn-delete").click(function(){
alert("This Row w...
I looked into previous questions, but they didn't seem to answer what's happening to me.
In my real code i'm creating a form on the fly and adding to it two buttons, one for submission and another for other function. For this I'm setting the "type" attribute of the buttons to "submit" for one and "button" for the other. The problem is th...
I have a DOM element like this:
<div id='master-value'>Apples</div>
I have many other elements elsewhere on the page that I need to sync with the 'master-value'.
<div class='fruit-value' data-reference='master-value'>Apples</div>
<div class='some-fruit' data-reference='master-value'>Apples</div>
When I change the value of the 'mast...