This works fine, but i'd like to eliminate the id attribute from script tag. I tried $(this).replaceWith('Duma'), and $(this).parent().replaceWith('Duma'), but neither works.
What I want to do is replace the all tag A's HREF attribute value (link) with new value of Javascript call some like SubmiPath(href) where href is old HREF attribute value of the A. Hope I made myself understood.
Here is the HTML <div id="pagination" class="pagination"> <ul class="pagination">
<span class="date" title="May 14, 2009">14 May 2009</span> and I'd like JQuery script to output it as this:<span class="date" title="">May 14, 2009</span> Basically, I'm checking the browser language and I want to display all dates in US date format to all users with EN-CA and EN-US browser language (and UK format to all other users). Please let me know if there is a better way of doing it, I couldn't find anything.
I'm trying to create a text-only version of one of my sites. I have a toggle link switching between text and full html versions. If text-only was selected, then it changes the stylesheet.However, I need to be able to replace all <img> tags with their associated alt attributes to make it completely text-only.
On my site I have a switch and JQuery fade in fade out when I click on 'Updates' or 'Projects'. Problem is that if I have scrolled down the page a little before clicking one of them, the page jumps back to top on clicking these options. I would like to eliminate that jump to the top.
I've painted myself into a corner, and I can't use any server-side solutions.
With some help, I've been working on a script on x.html that searches for a specific "image Y" within "Y.html" (inside an iframe). Then the script replaces the "Image x" url to the url of "image Y".
It drills through a specific div, to a specific span, to find this image Y. I have it this way, because it's a pre-built content management system that hasn't given me the ability to show the image on another page. I need to do this several times on one html file, so I'm running into huge load times, and there seem to be numerous clashes with servers and locking up. So I'm hoping there's a way to just avoid iframes and achieve the same result.
Here's the script that I've got, to help understand what I've done.
I am designing a dynamic web form, and all works fine except that I can’ t eliminate the ‘blank’ spaces that appears between the form elements when these are displayed or hidden. I mean for example, the long blank space that appears between the form submit button and the table rows displayed, because the other tables and form elements are hidden.
I attached the complete sample page so that you can see the ‘blank’ spaces I want to eliminate. These are the 'blank' spaces I want to eliminate:
1. When the page loads, a long blank space appears between the submit button and the table rows displayed. 2. When you select only the ‘Quality B’ checkbox, a long blank space appears between the ‘Product details’ title and the table rows displayed. 3. When you select both ‘Quality A’ and ‘Quality B’ checkboxes, a blank space appears between the table rows displayed. I want a blank space there, but smaller.
In all the cases I want the submit button just below (with a little blank space) the table rows displayed.
i have found a possible bug in 1.4 but it's only in Internet Explorer 7 & 8.The following code does not work and completely ruins every peice of jquery on the page (that means everything inside $(document).ready and anyting else...
I cant see any syntax errors - i pulled the example from the 1.4 site. There is no trailing commas in the object notation and i really cant see any reason it would work in firefox and not IEx and more to the point not only not work in IEx but break any other jquery in the entire page....
I'm working with a large (and unweildy) ASP.NET application, and there is a lot of jQuery code that uses selectors like this:
[name=_aspnetControl$_withASubControl] And unfortunately, some selectors that also look like this:
[name^=_someAspNetControl$_radioButtonList].
In other words, the effort to remove the $ from the attribute selectors would be monumental. If it is possible to escape the $ symbols, I can do that easily enough, but unfortunately the situation right now means that I can't upgrade to jQuery 1.5.
I'm learning jQuery with XML. I'm familiar with other query languages such as XPath. I'm having a little bit of difficulty wrapping my brain around how jQuery works but I think I can make the leap if I see a solution to a problem I know how to solve with other methods Given the following XML, please share a jQuery solution to finding the value of attribute B in elements named bar where attribute A has the value 30:
I am developing an iPhone version of a web app for a company I work with. The iPhone version is saved to the user's Home Screen as a pseudo-app (for lack of a better term). SSB might be more accurate. Everything in the site takes place in one window. Because there are navigation arrows within the web app itself, I don't want the browser's Back and Forward buttons to ever be enabled, because it can confuse the user. Hence, page navigation within the app is always done via location.replace().
My challenge was with the Login page. With a standard HTML form, the browser (SSB) navigates to the "action=" page specified by the form. So then you have a Back button. To work around this, I have created a "fake form" which simply writes the user's password to a cookie with a 5-second lifespan and then does a location.replace() to a Perl script that grabs and evaluates the cookie, immediately deleting it, and then writes the page to the browser. This works like a charm.
Question #1: is it an abomination to store the password in a cookie, even for a few seconds?
Question #2: At present I'm not encrypting it. Is there an effective client-side JS solution for encryption? Or, if it's client-side, wouldn't anyone be able to read the script and see how it was done?
I'll trying to tell the difference between the following three cases:
<img alt="text string" /> <img alt="" /> <img />
I can do this in Firefox with the following code, where elem is the HTMLElement representing each image, but IE doesn't seem to differentiate between empty string and undefined.
var alt = elem.getAttribute('alt'); alt = (alt) ? alt : ((alt===null) ? 'really_null' : "");
The desired output from running this code on the 3 tags above is:
text string
really_null
It seems like this should be really easy...but I'm having a really difficult time trying to figure out what's going on...
<script type="text/javascript"> var str="Welcome to Microsoft! Microsoft Microsoft"; var stringToBeFound = 'Microsoft' var ReplaceString = 'site' document.write(str.replace(stringToBeFound , ReplaceString )); </script>
My problem is im trying to use string.replace that is not case sensitive and replace every string found. I could use regular expression with it but my stringToBeFound is a dynamic variable im getting it from my database
i am trying to make an online graphing calculator with javascript. dont ask how because i dont know. but there is an annoying error in a do...while loop. although it should break out of the loop when the |'s (absolute value signs) are replaced with Math.abs( and ). here is the code.
i use it in a CMS. In my content page, when I insert a floating element, I use it to set the margin around element according to left or right float in this way:
I am new to jquery.I have made a function, that should only work if my attribute style on ul is not 0. However I think I am doing it wrong. I want to check the value of style attribute, not the string.[code]
I need to access a couple attribute values from a table when a button is clicked and I'm not sure how to access this information. For instance.. <tbody> <tr firstAttr='something' secondAttr='something'> <td></td>.... </tr> <tr firstAttr='something' secondAttr='something'> <td></td>.... </tr></tbody> When a button is clicked I need to grab those attribute values.
I'm using the jquery in place editor, and I need to get the value of a custom attribute in order to send it with the form. The jquery I have is as folder... (the bit I'm having trouble with is highlighted) $(".edit").editInPlace({ url: "./server.php", params: "folder=" + $(this).attr('folder') //show_buttons: true //$('.edit').attr('folder') });
And the html is as follows: <span class="edit" folder="folderName">text to edit</span> As you can see, I need to get jquery to get the attribute 'folder' value, in this case the value returned would be 'folderName'.
index.php if (idx == 8) { var str="<?php echo $username1; ?>"; document.write(str); jQuery.get("usermessage.php?username="+str, function(data) { document.write(data); var msgIDss = $(".messagepiece:last").attr("id"); document.write(msgIDss); }); }
usermessage.php <?php $username1=$_GET["username"]; $query2 = "SELECT id, message, datetime FROM messages WHERE username='{$username1}' ORDER BY id"; $result2 = mysql_query($query2,$connection) or die (mysql_error()); confirm_query($result2); $num = mysql_num_rows($result2); while($userinfo = mysql_fetch_array($result2)){ $msgID= $userinfo['id']; echo "<div class="messagepiece" id="" . $msgID . "">" . $userinfo['id'] . $userinfo['message'] . "<br><span style="font-size:13px; color:orange;">" . $userinfo['datetime'] . "</span></div>|"; }?>
My problem is document.write(msgIDss) display empty / blank value. On index.php, I have tested document.write(data); And it works. I have tested document.write(str) And it work too. I also tested open usermessage.php manually and it success display all the div(s), so usermessage.php page is not the problem. I guess the problem is on this line of code var msgIDss = $(".messagepiece:last").attr("id")
i'm trying jquery, and i want do do something .. that seems i cant understand how to do.thats my problem :i've got a page with some link and a div, every link calls this function :
function ajax_page(ele,url){ $(ele).load(url); setTimeout('justify()', 300);