Alternative To Anchor URL?

Feb 28, 2011

Is there an other way to link to an element on the same page without using anchor URLs?

View 18 Replies


ADVERTISEMENT

JQuery :: Reload Page With Anchor When Anchor Link Is Clicked?

May 26, 2011

I need to get the page to reload with the anchor in the link when it is clicked in a dropdown menu. For example if I am on 'www.domain.com/about/#2' and I then click on 'www.domain.com/about/#3' the url changes but the page doesn't reload so I need the page to reload, but keep the new anchor (#3).I gave the links with anchors a class of 'reload' and tried this:

$('a.reload').click(function() {
window.location.reload();
});

View 4 Replies View Related

Script-Added Anchor Preventing Jump Of Doc-Coded Anchor?

Jan 9, 2010

I have a script that scans an HTML document for headers and special comment tags for the purpose of generating a left-floating/position-fixed DIV that contains the document's outline or "table of contents." Within the DIV are lists (UL element by default) whose items (LI elements) are jump-to links (A elements) to the points (headers, special points marked for inclusion in table of contents) in the document. The problem is this. I have typical HTML document with links that jump to points (usually headers) inside the document, as shown below:

Code:

<body>
<p>This is addressed <a href="#later-text">later</a> in this document
<h1><a id="later-text"></a>Header Text</h1>
<p>...
</body>

But my script, being a document outliner that finds headers in a document, inserts another anchor as a jump-to point just before the first occurrence of text in the header (inserted A element shown in red below). This somehow disables the document-coded jump anchor (shown in blue below). And it occurs in FF and IE, which suggests it is not a browser-specific issue. Why does it occur? Is there something in the HTML spec that states that two anchors to which a jump occurs are not allowed to be adjacent elements in the document?

Code:

<body>
<p>This is addressed <a href="#later-text">later</a> in this document
<h1><a id="later-text"></a><a id="jump-1"></a>Header Text</h1>

[code]....

To reproduce what I am seeing, search for the text "Why Is A Survey Done". The first occurrence is a within-document jump-to link, which should jump to a header below it. If the script execution to generate a document outline is disabled, the jump works. But if the script is executed and the document outline generated, the jump-to link does not work.

View 2 Replies View Related

Using Anchor Jumps With 'instant' Anchor Based Navigation?

Sep 4, 2011

Having a little bit of trouble with a site I'm currently working on I'm using some AJAX for the instant g-mail/facebook style navigation, you know the kind, with no refreshes, etc. Problem is, to allow for back/forward and bookmarks, I currently use a URL that looks like:[URL].. This is fine, not a problem... The issue comes into play when I want to open up the news.html page, from my home.html page, and have it open to news item #6 (for example).

I can't add a #, because one is already being used to reference the anchor for the content div. Has anyone run into a similar problem before? If so, how did you resolve it? Can some jQuery be used to find the location of the news item div in question, on load, and scroll to it like that?

View 8 Replies View Related

Better Alternative For RSH?

Mar 16, 2010

I have been using RHS, but in IE, it sometimes doesn't work the way I expect. Also, last update was a long time ago.

So, does anyone know better alternative for RSH?

View 3 Replies View Related

OnBeforeUnload Alternative

Jul 23, 2005

Currently I use an onbeforeunload method, to do call various tidy up
methods when a user exits my web application - however I now need to add
additional support, for users migrating to Sun's JVM.

My understanding that the onbeforeunload call is a Microsoft one, and
the net result of having it in a page used by a SUN JVM user is that the
browser does not close.

Does anyone know of an alternative to this method, that is supported
by Sun's JVM?

View 4 Replies View Related

Alternative Scrolling

Sep 30, 2005

In my webpage I have an embedded Windows Media Player and an unordered
list with a table of contents.

When playing a video, the Windows Media Player is triggering events for
new 'chapters'.

The corresponding chapter in the unordered list is then highlighted
with css.

The list can contain up tot 100+ items. Because the page itself should
fit the screen without scrolling, i put the list in a scrolling div.

I also want the div to scroll automatically in order to keep the
current chapter inside the visible scope of the div.

Right now i do this by initually creating an anchor for each listitem.
When an chapterswitch event occurs i scroll to the corresponding
chapter with the folling line of Javascript code:

window.location = "#" + ListItemId;

There is one problem; the annoying tick sounds in IE. For my
application it is not rare to have 25 'chapters' switched in one
minute, so that's an awful lot of ticking.

I was wondering if it is possible to automatically scroll up or down to
a specific point in a div without the browser making any sounds.

View 3 Replies View Related

Alternative To <Noscript>

Jul 20, 2005

I was wondering if anyone can help me? I am having some problems wit
the <noscript> tag.

I actually use it to block banner advertisements from being displaye
in my website. I have used it at the <body> tag section and look
something like this:

<noscript>
<body>
</noscript>

What it does is stop the banner advertisement offered in most fre
websites from loading.

My question is how come it does not stop the banner from loading if
was to view the webpage in my Pocket PC using Pocket Internet Explore
Pocket IE)?

Everytime I load the page in Pocket IE, it displays a standard banne
that is found in all pages viewed using Pocket IE. I looked around fo
some answers and I found out that Pocket IE found in the Pocket PC 200
does not support the <noscript> tag.

Is there another way around this? I have written some pages that wil
load in my Pocket PC and I find it very annoying to see the banne
advertisement at the top. Code:

View 2 Replies View Related

AddLoadEvent Alternative?

Dec 7, 2006

I was wondering if there was an addLoadEvent alternative, that could be used before all images are loaded? I think it's something like when the DOM is ready...

View 1 Replies View Related

Looking For An Eval Alternative?

Aug 29, 2009

this is the code I'm working on:

Code:
var tabs = new Control.Tabs('menu');
var pattern = 'tab=';
var nStr = location.href;
if(nStr.match(new RegExp (pattern,'gi'))){
var id = nStr.split(pattern);

[Code]...

It searches for the query string 'tabs=' and then splits the result to get the id of the tab. Then it uses this to set the active tab. If the url doesn't include the query string it set the tab to the first one.

The code works but it uses Eval to convert the id string (id[1]) to a variable and I was wondering if there was an alternative.

View 2 Replies View Related

A Better Alternative To Try Catch Block?

Jul 23, 2005

Is there a more concise way to do something like the the
desired code below?

The gripe is with the try-catch syntax. It takes *way* too
many lines of code to evaluate a conditional expression
when zero or more parts of the conditional expression may
trigger an error. In this case, the trigger is a call to
a non-defined (null) object.

In other words, how can you do a more simple 'try' statement
that simply spits out true or false, depending on whether
the 'tried' code threw an error or not?

Defining a function don't seem to work because you
can't pass the 'try' code as an argument. Extending the
'Global' constructor is not an option, so now what? Code:

View 3 Replies View Related

String Replace Alternative

Jul 23, 2005

Is there a possibility to do a string replace in javascript without regular experessions. It feels like using a hammer to crash an egg.

View 24 Replies View Related

Alternative To Using Onload Command?

Jan 28, 2006

I'm working on integrating the a javascript wysiwyg editor (Xinha) with
my blog software (ExpressionEngine, aka EE). EE has extensions now so
it's easy to get the Xinha header code into the head section of the EE
web page.

But Xinha likes to use an onload command to launch:

window.onload = xinha_init;

....and EE is already using the onload command in the body tag of the web
page:

<body onLoad="document.forms[0].title.focus();set_catlink();" >

The onload command in the body tag is keeping the window.onload command
from working. At this point EE doesn't let extensions modify the body
tag.

Is there an alternative way to run the xinha_init command, without using
the window.onload command?

View 3 Replies View Related

Is There Any Alternative For Browse Button

Apr 12, 2007

I have a query on browse button, In my page , i want to upload
files , But i dont want normal <input type=fileto be used for this,
so can anyone tell me anyother alternative solution for this ,
Here I have a button and textbox, if i click the button, it should
popup a file upload dialog box ,after selecting a file, that path
should be pasted in that textbox...

View 2 Replies View Related

Alternative To Javascript Hrefs

Jul 20, 2005

I want to use an anchor tag to invoke some javascript and I've read that it's bad form to use <a href="javascript:foo()">

I've read endless usenet posts and hint sites on the net, they all suggest different things and I can't get any kind of consistency, and I can't find any solution that works properly for IE, opera and mozilla.

many of the recommended solutions go something like this:

<a href="javascript:void(0);" onclick="foo()" />

this generates an <a> that looks like a hyperlink (good) and it invokes foo() as well (also good). the problem is that if in function foo, I put

window.location.href = "some new url";

it just seems to get ignored. If I miss out the href altogether, the link works but it's not formatted as a hyperlink.

All I'm trying to do is make something that looks like a normal hyperlink but whereby I can build the URL with some javascript rather than having it coded into the HTML, and I have to say it's driving me mad!!.

View 6 Replies View Related

JQuery :: Is There Any Alternative For .closest?

Oct 5, 2010

I'm looking for an alternative for .closest(). My script refers to jQuery 1.3.2 which is not the latest, but does its job. By trying to implement my code into another script I noticed that this script uses jQuery 1.2.6. Well, 'changing that version was no option'.[code]This is my code. It should be used to clone special comments containing "In[" and in some cases "text".Unfortunately .closest() doesn't work out for me. i'm looking for an alternative.

View 1 Replies View Related

JS Alternative For Following Flash Effects?

Jul 14, 2010

Is there a javascript or jquery effect which can simulate the effects in flash shown on this page : http://www.macrolane.fr/Temoignages/Effects are on mouseover and mouseout on the squares

View 1 Replies View Related

Add A Textbrowser Alternative To This Js Menu?

Jan 28, 2009

my website tag7.ch consists of an html entry page and the main website. on the entry page there is a js menu that opens the main webpage in a new window in full screen. I love this function but browser that dont allow js doesnt have a chance to enter the main website.Do you know how the script has to be changed that there will be displayed some simple html text-links for non-js browser?greetings from switzerland,marcuswww.tag7.ch

<head>
<SCRIPT LANGUAGE="JavaScript">
function openPage(page, width, height, sBar) {

[code]....

View 4 Replies View Related

Alternative Content For Non-flash?

Jul 26, 2010

I have this code http://www.jsfiddle.net/Nntc7/ created by a pdf publisher, I need to offer non flash content to users but dont know javascript and I cant get the thing to work using swfobject, How do I edit this to allow for alternative content??

View 4 Replies View Related

<SELECT> Javascript Alternative

Mar 29, 2006

I am currently recoding my website to perform more efficiently. By performing more efficiently I mean that I will be recoding the server side mostly.

One Particular idea I had was for select boxes. Right now for a page that lists the information for a user (say country of birth for example, which has over 200 option values) the php has to print all the values of the countries in a loop as <option></option>. The reason why it has to print them out each time is because it has to select the users country name.

Considering that there are 200+ values and there are also about 8 other select boxes that also have their information to be selected and printed thru php loop, it can get to be quite a strain on the CPU (when a bunch of users are all doing it).

So I decided to use a javascript function for each box to select the correct option value to be selected according to what the user has chosen beforehand. It generally is the same thing only the client is doing the job and not the webserver.

So what I am asking here is that should I reply on the javascript to do this? I have the paranoia that there will be some occurances where the client doens't have javascript or the version of javascript wont support the DOM features that are used to perform the job.

So for the average browser to be doing something like this, should I still be worried about this or should I go back to using the server side to handle the selected box values???

View 2 Replies View Related

Alternative To Object.constructor.name

Feb 9, 2010

I need to detect the "name" of the constructor of an object. For example, myArray.constructor === Array is true, but I want something where that === 'Array' is true. I've heard of Object.constructor.name, but it's not widely compatible. (preferably without involving regular expressions)?

View 4 Replies View Related

JQuery :: Alternative To Html() For XML Documents?

Aug 6, 2010

I am retrieving an XML document like the following:

<SampleData>
<contentContainer>
<div>HTML goes here</div><div>HTML goes here</div>
</contentContainer>
<moreRecords>1</moreRecords>
</SampleData>

I was using a statement like this to take the content out of the "contentContainer" element and place it into another element:

$('#myDiv').html($(newXML).find("contentContainer").html());

This works great in Firefox, but doesn't in IE. I can use the following in IE using the text method, but that doesn't do what I want:

$('#myDiv').html($(newXML).find("contentContainer").text());

It appears that the html method isn't available with XML. Is there an alternate method I can use to grab a whole chunk of HTML within a portion of my XML document?

View 1 Replies View Related

JQuery :: Alternative To Live (Change) In IE6

Jun 18, 2009

So I have a set of <SELECT> elements that are ajax'd in and out depending on what is selected using the event "change". I know that .live("change") is not fully supported.

View 2 Replies View Related

GetElementById Alternative For Multiple Instances?

Apr 23, 2010

The code works, but it obviously can't be used for more than one picture per page because getElementById finds the first div and always displays it onmouseover of any attempted mouseover text.The Javascript in <head> is

<script type="text/javascript">
// Pop up code begin
function ShowPopup(hoveritem)

[code]....

So the display code is

<a id="hoverover" style="cursor:default;" onMouseOver="ShowPopup(this);" onMouseOut="HidePopup();">text here</a>
<div id="hoverpopup" style="visibility:hidden; position:absolute;"><img src="url here"></div>

I just want to be able to have more than one instance on each page and still be able to declare the image url in the body and not within the javascript.

View 8 Replies View Related

DXHTML Alternative To Script-compiled CSS

Apr 17, 2003

I often script-compile CSS, like:

var sty='<style type="text/css">'
+ 'p { color:red; }'
+ '</style>'
document.write(sty);

How can I do that without document.write?

View 15 Replies View Related

Free CKEditor + CKFinder Alternative?

Feb 6, 2010

Does anyone of you knows a good free CKEditor + CKFinder alternative?

View 2 Replies View Related







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