I want to add a small but informative weather widget to one of my web sites. Having searched around, most are either too big or too simple.
I did find "one" that I liked but it links to a lame page. I would rather have no link rather than the one provided. The widget I like is a simple javascript "include file" similar to this one:
I'm using a script that has the back-end functionality mashed up so I can't change it. An image with a link around it hides behind this:
$RateUserThumbnailLink$ And i'd like to disable the link somehow as the owner wants money for the edit which is ridiculous. Can anyone figure out a way of disabling the link it generates?
I'm working on a project where we're using JavaScript to let users swap styles on a page. To accomplish this, I'm calling the script via href="javascript:swapcss()" on the switch styles button.
Some pages on the site have anchor links. On those pages, if someone swaps styles without hitting any of the anchor links, all is well. But if someone hits an anchor link and then hits the swap button (at this point the URL is pageid.html#anchor), the page just reloads to their anhor point without swapping styles.
Does anyone have a workaround handy? I've tried several alternatives I've found online (href="#" onClick="action"; href="javascript void(0)" ). Nothing works for this case yet. Code:
I also have added a fallback page in the href (do.htm) in case users have JavaScript disabled. But the JavaScript doesn't seem to be working. When I click the link it always goes to the fallback page, and doesn't submit the form.
I've tried swaping the order in the anchor tag (JS first, href second):
It worked fine as long as the href attribute of the anchor tag was '#'. Then I tried using href other than '#' and ran into a problem. I just changed the href to:
Right, so there are a bunch of links in this format: <a href="/profiles/########">username</a>
I'm using greasemonkey, and what I want to do is go through and get all of the /profiles/######## part of the anchor tag. I'm using Regex and I can't seem to get a match.This is what I have so far:
function ok() { var names = document.getElementsByTagName('a'); var reg = new RegExp("WHAT GOES HERE?");[code]....
what is actually desired is I want there to be a way I can select these somehow as well..
I am looking for a generic javascript function to identify the form with in which a element exists, thus developer can avoid coding like document.forms[index].submit() - where they are sure, they want the form with in which this element exists is to be submitted. This way when forms are introduced at top level the code can remain unchanged, else every form introduce above in the DOM will result in increasing the index by one.
The code is given below. While doing so i am stuck with 2 problems P1: In the code, you can see i am giving a explicit 'break' in the code. If i don't do so the code seems to be looping. Obviously i am missing some basic.
P2: I am able to pass 'this' for anchor element by name="xy" <a href="#" name="xy"
in its onclick function by which, in the javascript function i move up the DOM.
While i am unable to do that on the anchor element given below since this function is now on the href attribute.
I have a set of vertical tabs about a quarter of the way down my page. They are all visible on page load from the top of the browser window. When you click on a tab, it scrolls down and puts the tab content at the top of the window. I know why it does this, is there anyway to override this behavior so that the tabs change content but the window does not scroll?
I want to be able to match all <a> tags on a Web page that are external links, which would be signified by the href attribute starting with "http://", obviously. Then I want to add an attribute to the matching tags.
I ran across this script that is supposed to do that:
But it doesn't work. I don't understand regex very well yet, so I'm not sure if that part of it is right, but the jQuery syntax looks correct to my inexperienced eyes.
I know jQuery is working on the site already, the script is below the call the the jQuery library, and yes, I do have the script in the Head tag of the page...
There are three div and inside each of them there is an anchor tag.
When the anchor tag is clicked it makes an Ajax call and displays the content in the new div. Lets call this our forth div. (this is irrelevant to the title but just want to mention this because I am calling a function onclick.)
What I want to happen is when they click on of the anchor tag I want to change the background color of the div relative to the anchor tag. For example, if they click on the first anchor tag which is inside the first div I want the first div background color to change.
I have some text, where I don't want to display all of the text until the user clicks 'more' link. Once the user clicks 'more' link I want to show the div below and change the link text from 'more' to 'less' so on subsequent click the div below will collapse. <a href="#" class="moreLink" onclick="javascript:ShowMore(this);">more</a> <div id='completeDiv'>etc etc etc </div> function ShowMore(object){ ....show the div and $('a.moreLink').text('less'); ---> this does not work for me. }
I found a nice script over at jQuerry for Designers that I'm using in a Drupal site. It seems to work fine, except for that every anchor tag on the page triggers the script! how can i adjust the script to target a specific anchor (currently has an ID of "test") and ignore all other anchor tags? here's the script, its placed in an external .js file:
I have two pieces of Javascript attached to my open/close text boxes.
One for the visibility function: <script type="text/javascript"> function toggle_visibility(id) {
[Code].....
The problem only shows further down the page, when I click to open a box it automatically goes back to the top of the page instead of staying at the user's current page position
I would like it to stop changing the page position onclick.
I have an Iframe which loads an articles html page with anchors at the start of every article. To the right is fixed div that has different article links. The customer can scroll down and read all the articles. I would like the links to change to active, visited etc. when the anchors come into view. I was thinking it would be something like this:
Code:
function changelink(){ if(window.location.href='#article3'){ document.getElementById('historylink').style.color='green'; historylink.style.background='url(sources/active.jpg)center';
[Code]...
Haven't tried it yet because it dosen't take into account the visited state of the links so I figured I need some advice from the skript Gods.
I have a button that change a number of images src's when I click a button. The src's are stored in an array and I just use document[imgName1].src=pics[0] to change the src of the image. However I want the button to change the link as well to the image that is displayed but i cannot get it to work. How do I do this. Could someone tell me or point me in the direction of some code that will do this.
I would like to do it in a similar way to the pictures. i.e. have all the links stored in an array and change them when the button is pressed.
I am using some javascript code to change an image on an html page. I would like the user to click on the image to bring them to another page. I need to change an href to include an id value based on the image.
Here's the process:
1. select an image from a drop down list. 2. view the image on the same page. 3. click on the image to bring user to another page.
I also think that txtString is not what I need. I believe it is a text string (12345.jpg). So I will need to parse the string as well to get the "12345".
We are developing an Ajax based application. In this application the URL is fixed and as user navigates on the application we will change Anchor on the URL so that user can bookmark the url and can load the page on demand.
When user refreshes the page we have no issue in the populating the page based on the anchor in URL as on load we can capture the hash(#anchor) and act accordingly.
When the user clicks back button anchor is changing but not able to know where to get callback. Is there any event or way I can find when the user has clicked back button.
I want to add a color change to an anchor tag. But only on a few pages. I am trying this but it does not work: $(function(){ var urlName = [URL] if (urlName == window.location.href) { $('.news-list-item > h3 > a:first').css('color','#8CAAC3').css('text-decoration','underline'); }});
I have a simple image gallery consisting of an image with smaller thumbnails below that change on click which works fine.I now decided to change a link along with the gallery image source on click, but can't really get it working.Here is my code to swap the image to the clicked thumbnail image:
jQuery("ul.thumb li a").click(function() { var mainImage = jQuery(this).attr("href"); jQuery("#main_view img").attr({ src: mainImage });
there is a text box in a html page... When a user writes "23 April" And click "Go" and then an excel file should get open named "23 April.xls" and if user write any other date than it should open file with name of that same date with the extension .xls And also if there is any date picker to insert a date in the text box but in the format dd mmmm, eg. "14 March"
Now I have a code where i have a text box and a go buttom and if a click write anything and click go button then i will directed to the xls file with the name written in the text box.... BUT I AM NOT ABLE TO LINK A DATE PICKER TO THE TEXT BOX WHICH INSERTS THE DATE IN THE dd mmmm FORMAT Eg: 23 April
CODE I ALREADY HAVE FOR OPENING A PAGE
<html> <head> <!--
[Code]....
The thing is i am trying to create an intranet website for my office use only with the help html.. now on one of the page I need a link for the weekly based data stored in excel files... the name of those files are "Schedule for Week 04th May to 10th May.xls" So I need a popup calendar to insert a date and when a button click is hit then the above metioned file should open...
The above mentioned file has the date for the first and the last day of the week.. where the week starts on monday...
I am having a problem changing HREF and Text of a link from javascript. My code is as colos <a href="javascript:Action(9,'remove');" id="thelink">Remove</a>
I am in a problems here trying to generate link by two dropdown boxes. So, I wanted it to be like when user selects some option from dropdown one the href attribute changes, index.php?staticvar=something&dynvar1=something, that is something I have already managed to do:
function change_href(id) { if (id != '') { var dynvar1 = document.getElementById("s"+id).value; document.getElementById(id).href = "index.php?staticvar="+id+"&dynvar1="+dynvar1; return; } else { return false; } } This works perfectly for me, but now I need to modify the href with another variable, so it would be needed to be like: index.php?staticvar=something&dynvar1=something&dynvar2=something2
The problem is that I don't know how to make it the way that user can change their selections, for example if user first selects (from dropdown) dynvar1 to be "test" and dynvar2 to be "test3", but then changes hes mind and decides to re-select dynvar2 to be "test4". It would be needed to be like only the dynvar2 part of the href changes with proper value (not changing the dynvar1 or staticvar).
I managed to make it changeable but it was like this: index.php?staticvar=something&dynvar1=something&dynvar2=123&dynvar2=123
So, it didn't update the dynvar2 part, but instead just added another dynvar2 variable.
Lets say I have a bunch of links with the same class but different anchor text like [code] When the page loads I want the anchor text of each link to display the same text of my choosing. However, when the visitor clicks a link the anchor changes back to the orignial. It would be best if all links could be changed back their original if any link is clicked but this isn't necessary.