JQuery :: Marking Extern Links?

Nov 4, 2010

im new to jquery and im still learning but i got a problem. this script to mark extern links does not work, but i cant find out why.

$(function () {
$('a[href~="http://"]').live(function() {
this.attr({target: "_blank"});
this.addClass("extern");
});
});

i use live() because it should also mark ajax loaded content.

View 2 Replies


ADVERTISEMENT

How Do I Put My Script In An Extern File?

Jul 23, 2005

I have a script placed somewhere in the body of my HTML-doc.
I noticed that i'll be using the very same script in a large number
of document (all of them as the script regards the time of the
most recent edition of the given file).

I could place the script in every single document BUT:
1. I'm far too lazy to go through 100 documents doing one and the
same thing. That's for monkeys, not lazy humans.
2. Even if i wasn't so lazy, i'd have to reedit every single
document once i made a small change to the script. That's for
crazy monkeys!

So, how can i place the script in a file and how do i call the
file from my HTML-code? Code:

View 11 Replies View Related

Marking An Element As .checked And Reading InnerHTML

Aug 26, 2006

I have this code snippet:

updateProps snippet:

if (mycheckbox.checked == Ƈ')
? $('mycheckbox').checked = true
: $('mycheckbox').checked = false;

content = $('mydiv').innerHTML;

html snippet:

<div id="mydiv">
<input id="mycheckbox" class="checkbox" type="checkbox" value=""
tabindex="14" onchange="(this.checked) ? checkVal = &#391;' : checkVal =
&#390;'updateProps(checkVal, 'mycheckbox')" />
</div>

The problem is that when I display the contents of content it doesnt
have 'checked'. But if I alert($('mycheckbox').checked); it says it is
true

Is this a problem with innerHTML not grabbing the correct data or the
checkbox not actually being checked?

View 4 Replies View Related

JQuery :: Buttons As Links - Working In Firefox And Safari - But In IE Links Do Not Work

Apr 30, 2010

I am new to jquery, and love it so far, but I am more of a designer, not a developer. I am learning jquery to enhance my sites, and I am having a problem figuring out buttons.

I have them working in firefox and safari, but in IE links do not work.

Here is the script I have, and the button code.

View 1 Replies View Related

JQuery :: Menu Navigation - Submenu Links Have A Rounded Box Appear Under Them Instead Of Being Underlined Links

Aug 26, 2009

My menu navigation(Home, Hosting Solution, etc..)

1. The submenu links need to be centered in the middle of the div instead of aligned to the left.

2. Can the submenu links have a rounded box appear under them, instead of being underlined links. Like these at the top: [url]

3: The top tab needs to stay gray/active/on when the mouse is moved down to the submenu or when it is the active button.

Here is the link of the site [url]

View 2 Replies View Related

Jquery :: Create Some Links With Window.open Method - When I Alert What Is Being Built, The Links Don't Work?

Mar 10, 2010

I'm using jquery/ajax to create some links with window.open method. Here's the relevant code:

$("#content").empty();
$.ajax({
type: "GET",[code]..........

Basically, when you click a link a function is called with a parameter based on the particular link you run. Then the code runs through an xml file, and if the parent of the nodes I've cyling through has a value equal to the parameter past to the function, that node is used to create a new link with window.open function attached to it.It all works, or seems to, and when I alert what is being built, it looks right to me, yet the links don't work.I've attached a copy of one of the alerts of one of the links as it's built.

View 5 Replies View Related

JQuery :: Text Links Trapped - But Not Image Links

Nov 28, 2010

I have an image wrapped inside a link tag.<a href="somepage.html"><img id="content" src="img/some.gif" /></a>

I want this .click target to be the link: $('a').click(function(e){

Instead, the target returned is the image [HTMLImageElement].

I have tried using closest()and currentTarget:

But they all still return the image, not the link.

View 2 Replies View Related

JQuery :: Links Not Working If A Div Is After Them?

Mar 30, 2011

I am creating a several step sign up process for our company. I want a new div for each step along the way. I will then either accordian or some other style for them as the customer progresses through the process.

I want to use a hierarchy like
div#step1
-->content
div#step2
-->content

[Code]...

View 3 Replies View Related

JQuery :: Selectors For Links <a>?

Nov 28, 2011

I am trying to assign a click event handler to any of the <a> elements in the code below:

<div data-role="content" id="picSpace" class="ui-content" role="main">
<div class="ui-grid-b" id="gamePics">
<div class="ui-block-a">

[code]....

View 5 Replies View Related

JQuery :: Get/loop Over All Links In A Div?

Sep 26, 2011

I have a collection of links on a page with unique ID's in the form of:

Code:
<a id="tag_t1"
<a id="tag_t2"

[code]....

View 5 Replies View Related

JQuery :: Broken Links In Documentation?

Jun 30, 2011

Seehttp://api.jquery.com/category/deferred-object/links tohttp://api.jquery.com/jQuery.thenhttp://api.jquery.com/jQuery.doneetc don't work.

Is it possible to post a patch to the docs somewhere?

View 1 Replies View Related

JQuery :: Change Day Links To Webpage?

Jul 6, 2011

I am trying to make the link on each day in the calendar go to a new page on the site instead of populating a form with the current day.

For example, if you click July 6, 2011 I need it to go to /events.php?page=calendar&event-date=2011-07-06 The link shows "/events.php?page=calendar&event-date=" when you hover over it, but it does not actually link to anything. I also need to dynamically pull the date clicked into the url.

View 1 Replies View Related

JQuery :: Add Icons To Links Automatically?

Jul 15, 2009

there I am using the working with the following scriptAdd icons to your links automatically using jQuery & CSS

http://cool-javascripts.com/jquery/add-icons-to-your-links-automatically-using-jquery-css.html
// Add pdf icons to pdf links

[code]....

View 2 Replies View Related

JQuery :: Loading Links URL Into Content DIV

May 12, 2009

I successfully loaded a list of links (e.g. <a href="info2.php">More info</a> into the #submenu div using the first part of the code below, and want these links, when clicked, to load their URL into the #content div.

$(function(){
$('#submenu').load('submenu.php');
$('#content').load('info.php');
$('#submenu a').click(function() {
$('#content').load(href);
});});

View 3 Replies View Related

JQuery :: Thickbox And Links That Are In A Select?

Jun 30, 2009

A better question. Hopefully I won't figure out the answer before I finish asking this one. Is it possible to have a select box, and when the item is selected have it open in a thickbox? This is easy to do with traditional anchor tags and its also easy to open links when they're selected from a select box. Its the combination that has me stumped.

View 2 Replies View Related

JQuery :: Treeview: Using Links That Don't Toggle?

Jul 8, 2009

I have a treeview with links in that navigate to other pages when clicked. I didn't want these to cause toggling when they were clicked. My lists are prerendered. I didn't find a very good way to do this, but the following works, This function goes in the head, it is to stop the event bubbling up to the default treeviewcode. function lihyperlinkclick(e)

[Code]...

View 1 Replies View Related

JQuery :: Match Links To More Than One Possible Domain?

Mar 4, 2010

Here's my situation: I'd like to have links to my organization's sites open in the current window, but links to other sites open in a new window. The tricky part is that not all of our sites are on the same (or even similar) domains.This works just fine for matching foo.org:

$(".article a[href*='http:']").not("[href*=foo.org']").attr('target','_blank').addClass('external');

I'd like to widen this so that links to foo.org, bar.net and whatever,com all open in the current window. It seems like everything I try won't work because I can only match all instead of any.

View 5 Replies View Related

JQuery :: Opening Links In A New Window?

May 2, 2011

how to actually open a link in a new window instead of a new tab.

So far the suggested codes around the internet all come to something like this:

<a href="http://whatever.com/profile/1" id="upload_link" rel="external" target="_blank">To open in new Window</a>

And the jQuery is something like the following:

$("#upload_link").click(function(event) {
event.preventDefault();
event.stopPropagation();
window.open(this.href, '_blank');
});

I read it has worked for some people out there, but in my case it's working only to create new tabs!

I need it to open a new window in Chrome, Firefox and Safari, one with fixed width and height if possible.

View 4 Replies View Related

JQuery :: Page Links Not Showing?

Jul 5, 2011

For some reason it's not displaying any of the page links and I don't know why.

(function($) {
$.extend({
tablesorterPager: new function() {
function updatePageDisplay(c) {

[Code]....

View 1 Replies View Related

JQuery :: Prev And Next Links In Gallery?

Mar 15, 2011

I'm rather new toJavaScriptand have spent all day trying to figure out how I can make this possible by examining others code but to no avail. I've finally bit the bullet and come to ask for some help.

I'm making a website for a friends photography and have managed to get a thumbnail gallery working as you can see here[URL]...The problem is I have no idea how to get get the prev and next links working. I have tried countless searches for the best part of the afternoon looking for a solution but mostly all I seem to uncover is lists ofpre-madegalleries andcarousels.

It would be fantastic if someone could point me in the right direction just to simply get these links incrementing and decrementing based on the image that is loaded.

View 1 Replies View Related

JQuery :: Show All / Hide All Links For FAQ?

Feb 6, 2010

I'm using a simple jQuery show/hide toggle effect for the FAQ on this page:

[URL]

I would like to add Show All / Hide All links to the top and bottom of the page that will show and hide all answers at once.

View 1 Replies View Related

JQuery :: Show Links When Hover

Apr 1, 2010

how can i achieve this in jquery.. when i hover my mouse it will show some link like the RSS, Permalink..just like in the picture..coz i want to add some delete option on my page.

View 3 Replies View Related

JQuery :: UI Dialog Breaking <a> Links?

Aug 24, 2009

I have a simple UI Dialog to display a loading notification.

If I call foo.dialog('open') then foo.dialog('close') is called in quick succession all of the <a> links on my page stop working. All the inputs work fine, just the links don't work.

If I open another dialog that closes after a delay then the links begin working again.

View 3 Replies View Related

JQuery :: Using Links To Send GET Request

Aug 21, 2011

Here is my base html:

[Code],,,

The ajax call works, but what i get is always 1, whatever link i'm clicking.

View 2 Replies View Related

Jquery :: Php Dynamic Links And Show Div

Jun 15, 2011

trying to make a simple web app that will let a user select from a catagory, then, when the catagory is selected, it stores the selection in a php session variable, which will be used in another sql statement to retrieve a locations list where catagory = "the stored catagory selection". The new list of locations will be displayed in a second div and each item in the locations list will also get information from the database when selected. Im able to pull the first catagory list from the database and show the div that they are displayed in using jquery and php but the new list of links will not change to show the contents of the third div.

View 6 Replies View Related

JQuery :: Hover Effect With Links

Sep 1, 2009

I would like to create something similar but not sure where to start, looking at the code, it would seem they are using jQuery, rather than grab the code, I would like to learn a little bit about how it was implemented, what plugins were used, if any.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved