Search Results

Search found 3639 results on 146 pages for 'dom manipulation'.

Page 9/146 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Jquery Dom and functions in html body

    - by slick
    I have before my closing body tag here i have the usual $(function() { function test(){ alert("test"); } }); in my html i have input tags I get an error of that test is undefined. I am trying to make IE7 call function onchange I had a whole solution working but since IE7 does not like .change() i am going to put onchange attributes within the inputs but now i have this issue. Any idea how I can solve this?

    Read the article

  • jQuery code not executing when DOM is ready

    - by Ben
    I have written a simple jQuery script that changes the hash tag of a link. I do this because I am using IntenseDebate comments in Wordpress but the comment link still links replaced id of the old comments. I'm using jQuery so that if javascript is enabled, the user can click on the comments link and it will take them to the IntenseDebate comments. If its not enabled it will take them to the traditional comments (because IntenseDebate requires javascript to function). The issue I'm having lies in this script to change the hash tag at the end of the link. Currently the URL "someurl.com/#respond" but I need the script to change it to "someurl.com/#comments". What is happening is that the script doesn't work, however I believe my syntax is correct so I decided to try copying and pasting the code into Firebug's console and the code executed perfectly. I could see that the link I was trying to change was now correct, and I could click on it and it worked as I desired. So what I don't understand is why the code is not executing when it is supposed to. I am using $(document).ready() and I have other jQuery on the page that executes just fine. I even tested it on a simple HTML page away from all the problems that might be caused by Wordpress and I received the same result. Does anyone know why this might be happening? Here is my code (I am using noConflict because Wordpress makes use of other frameworks): jQuery.noConflict(); jQuery(document).ready(function($) { $("a[href$='respond']").each(function() { this.href = this.href.replace("respond", "comments"); }); })(jQuery); Thanks very much for your help!

    Read the article

  • How can I programmatically copy all of the style attributes from one DOM element to another

    - by stu
    I have a page with two frames, and I need to (via javascript) copy an element and all of its nested elements (it's a ul/li tree) and most importantly it's style from one frame to the other. I get all the content via assigning innerhtml, and I am able to position the new element in the second frame with dest.style.left and dest.style.top and it works. But I'm trying to get all the style information and nothing's happening. I'm using getComputedStyle to get the final style for each source element as I loop through each node then and assigning them to the same position in the destination nodelist and nothing happens to visually change the style. What am I missing?

    Read the article

  • PHP Dom problem, how to insert html code in a particular div

    - by sala_7
    I am trying to replace the html code inside the div 'resultsContainer' with the html of $response. The result of my unsuccessful code is that the contents of 'resultsContainer' remain and the html of $response shows up on screen as text rather than being parsed as html. Finally, I would like to inject the content of $response inside 'resultContainer' without having to create any new div, I need this: <div id='resultsContainer'>Html inside $response here...</div> and NOT THIS: <div id='resultsContainer'><div>Html inside $response here...</div></div> // Set Config libxml_use_internal_errors(true); $doc = new DomDocument(); $doc->strictErrorChecking = false; $doc->validateOnParse = true; // load the html page $app = file_get_contents('index.php'); $doc->loadHTML($app); // get the dynamic content $response = file_get_contents('search.php'.$query); $response = utf8_decode($response); // add dynamic content to corresponding div $node = $doc->createElement('div', $response); $doc->getElementById('resultsContainer')->appendChild($node); // echo html snapshot echo $doc->saveHTML();

    Read the article

  • Selectind DOM elements based on attribute content

    - by sameold
    I have several types of <a> in my document. I'd like to select only the <a> whose title attribute begins with the text "more data ..." like <a title="more data *"> For example given the markup below, I'd like to select the first and second <a>, but skip the third because title doesn't begin with more data, and skip the 4th because <a> doesn't even have a title attribute. <a title="more data some text" href="http://mypage.com/page.html">More</a> <a title="more data other text" href="http://mypage.com/page.html">More</a> <a title="not needed" href="http://mypage.com/page.html">Not needed</a> <a href="http://mypage.com/page.html">Not needed</a> I'm using DOMXPath. How would my query look like? $xpath = new DOMXPath($doc); $q = $xpath->query('//a');

    Read the article

  • Load DOM before css?

    - by Tim
    My jQuery code sets the height of an element to 0px as soon as the page loads, then animates it to 500px. In my CSS, this element is already set to 500px (in case anyone has javascript turned off). I tried 'DEFER' on the tag where I link to the stylesheet so that the CSS loads in last of all, but that causes a blank white page to show up between navigating through pages - which I don't want, because I lose the smooth page transition effects that I am after. Is there a way that I can set the height in the CSS to 0px and IF javascript IS turned off, have it set to 500px, perhaps? :\ That's what I'm after, in effect. Any ideas? Many thanks for your help.

    Read the article

  • DOM Level 3 CustomEvents not bubbling on WebKit

    - by Edu Felipe
    I'm observing CustomEvents not bubbling, even though I set bubbling to true. The code below: var evt = document.createEvent("CustomEvent") evt.initCustomEvent("mycustomevent", true, false) var someh1 = document.getElementById("someh1") someh1.addEventListener("mycustomevent", function(){ alert("OMG!"); }) document.getElementsByTagName("body")[0].dispatchEvent(evt) With the HTML below: <html> <head></head> <body> <h1 id="someh1">content!</h1> </body> </html> Never shows the alert, demonstrating that the event is not bubbling down. Am I doing something wrong? Please note that if I do a getElementById("someh1") and run the dispatchEvent on it, the alert is displayed. Thanks!

    Read the article

  • Dom Element onclick (MooTools :: optionally)

    - by Theofanis Pantelides
    Consider the following example: function async_callback(array1, array2, array3) { // All arrays are equal length for(var i = 0; i < array1.length; i++) { var myElement = new Element('div', { 'id': 'dvMy' + i, 'events': { 'click': function() { SomeFunction(array1[i], array2[i], array3[i] } }}); $(document).appendChild(myElement); } } Now when I click my element, I get a null value for all three arguments. I even tried doing: myElement.onclick = SomeFunction; // but this won't allow arguments I know I can create a string and use eval() and that does work, but I don't like eval(). Any ideas??? btw: This is a simple example to replicate the problem, and not actual code.

    Read the article

  • DOM accessing element JS

    - by Michael
    Given the following xml <rss> <channel> ... <pubDate>20/30/2099</pubDate> ... <item> ... <pubDate>10/30/2099</pubDate> ... </item> ... <item> ... <pubDate>40/30/2099</pubDate> ... </item> ... <channel> </rss> how would I efficiently access pudDate in channel and items as array, as well as pudDate in that array.

    Read the article

  • [DOM/JS] display table in IE

    - by budzor
    I have code like that: var xPola = 10, //how many cols yPola = 10, //how many cols bokPola = 30, //size of cell body = document.getElementsByTagName('body')[0]; var tablica = document.createElement('table'); body.appendChild(tablica); for( var y = 0; y < yPola; y++ ) { var rzad = document.createElement('tr'); tablica.appendChild(rzad); for( var x = 0; x < xPola; x++ ) { var pole = document.createElement('td'); pole.setAttribute('width', bokPola); pole.setAttribute('height', bokPola); rzad.appendChild(pole); } }; it works fine in FF, Chrome & Opera (it displays 10x10 table with 30px width&height rows). In IE nothing happens. I check in firebug lite and it is in HTML section, inside BODY tag but i see nothing. Whats wrong?

    Read the article

  • Accessing HTML DOM elements from javascript using `.childNodes`

    - by Martin
    I'm wondering about the .childNodes property, I have the code below, and for some reason I get 18 children, while 6 are HTMLInputElements as expected, and the rest are undefined. What is this about? Is there an efficient way to iterate over the input elements? <html> <head> <script> window.onload = function(e){ form = document.getElementById('myForm'); alert(form.childNodes.length); for(i=0; i<form.childNodes.length; i++){ alert(form[i]); } } </script> </head> <body> <form id='myForm' action="haha" method="post"> Name: <input type="text" id="fnameAdd" name="name" /><br /> Phone1: <input type="text" id="phone1Add" name="phone1" /><br /> Phone2: <input type="text" id="phone2Add" name="phone2" /><br /> E-Mail: <input type="text" id="emailAdd" name="email" /><br /> Address: <input type="text" id="addressAdd" name="address" /><br /> <input type="submit" value="Save" /> </body> </html>

    Read the article

  • Modifying html of dom element that was created after page loaded

    - by Ben321
    I have two separate AJAX calls. One that gets a list of items from a txt file and creates an HTML table out of them and one that talks to a database to find how much each item costs and then lists this in the corresponding table cell for each item (I know this may sound like a strange approach, but it's a good option in our case...). The issue is that the price is not getting written to the table since the table is created (or to be precise, the rows of the table are created) after the page loads. I'm not sure how to fix this. $(document).ready(function() { makeItemTable(); listPrices(); ... }); function makeItemTable() { $.ajax({ url: 'products.php', type: 'GET' }) .done(function(response) { $('.price-table > tbody').html(response); }) } function listPrices() { .ajax({ url: 'prices.php', type: 'GET' }) .done(function(response) { priceData = $.parseJSON(response); $('.price-table tr').each(function() { var item = $(this).find('td:nth-child(1)').text(); if (priceData[item]) { var price = priceData[item]; $(this).find('td:nth-child(2)').text(price); } }) }

    Read the article

  • Meta package / quick reference for string manipulation commands?

    - by Dylan McCall
    The latest version of the Scribes text editor lets us select some text, hit Alt+X, and then run an arbitrary command. For example, I can run the sort command and the selected text is replaced appropriately. This is quite useful but I am also not very well-versed in awk and the like. Is there something I can grab that will provide more of these commands like sort? Maybe a package with a whole bunch of handy, task-specific string manipulation commands?

    Read the article

  • SQL Server and the XML Data Type : Data Manipulation

    The introduction of the xml data type, with its own set of methods for processing xml data, made it possible for SQL Server developers to create columns and variables of the type xml. Deanna Dicken examines the modify() method, which provides for data manipulation of the XML data stored in the xml data type via XML DML statements.

    Read the article

  • jQuery to get innerHTML not working on a HTMLFontElement object...

    - by Matt
    I have jQuery to select all font elements that are children of the element with id="right" within the html stored in the var html... when I do an alert to see how many elements it gets: alert($("#right > font", html).length); it gives me an alert of: 5 but when I try any of the following, I don't get any alerts... alert($("#right > font", html)[0].html()); alert($("#right > font", html)[0].text()); alert($("#right > font", html)[0].val()); Any Ideas? Thanks, Matt

    Read the article

  • Replacing text node of HTML input in PHP

    - by Aman Kumar Jain
    Hi, I want to replace all the text nodes in a html text. I'll explain with an example: $html = " <div> <p> text2 text2 word text2 <span>abcd</span> text2 text2 word text2 <p> this is a long, very long statement with punctuations. </div> I want to replace "text2 text2 word text2" with "<span>text2 text2 word text2</span>" and "this is a long, very long statement with punctuations." with "<span>this is a long, very long statement with punctuations.</span>" What should be the regular expression for the same?

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >