Simpler Href's Must Be Operated Sooner!
Aug 30, 2006
sometimes simple href:
Code:
<a href="javascript:history.back(1)">Back</a>
or
<a href="index.jsp">Home</a>
takes an almost long, about 5 seconds for loading or even so, to operate.
Could you tell me of the reason and also of possible different suggestions.
View 2 Replies
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
Jun 15, 2009
I work on a portal website that has approximately 700 pages and several thousand links.Some of these links are to various documents (.doc, .pdf, .xls). I would like to use Jquery to dynamically find these links on a page when the pages load and add another link directly after it that can invoke a modal window. When the modal window opens I need to hold onto the values of the original link as it will be stored in a DB. So I think I will need the second link to contain the first links name and URL pattern as some sort of property that I can store. I am not sure the best way to accomplish this. For example:
[Code]...
View 2 Replies
View Related
Jun 30, 2010
Ok so i'm trying to write a Greasemonkey script to change all the hrefs on a single page. The href by default looks like this:
<a href="javascript:get('246154895')" class="postid">ID</a>
What i'm trying to do is make the number from get() appear in stead of "ID". How should i get this done? I started up with this:
var posts = document.getElementsByClassname('postid');
for (i=0; i<posts.length; i++) {
//Replacing
}
But i doubt it will work, since there are other items with the class "postid" that aren't related to these tags i'm trying to change.
View 5 Replies
View Related
May 2, 2009
e new to jQuery and have a question. I'm populating a table with rows where some of the columns include links and buttons. For some of these links and buttons I want to run some jQuery stuff before it's redirected (acually, I want to have the result loaded in a div via ajax). In the jQuery function I want to be able to extract the ID of the button or the href target that was clicked.
[Code]...
View 1 Replies
View Related
Aug 4, 2010
how i can make the function "sistaefternamn" easier/simpler. And an explenation of the simplification would be nice. Here comes the code.
[Code]..
View 4 Replies
View Related
Apr 24, 2011
Iīve gone thru a few exaples of the 'hello world' equivalent for ajax; the classic example having main.html with div id="main_panel", then having ON THE SAME folder of the main.html file, the few files for getting via ajax and then render itīs content inside div id=main_panel and so on, happy with that;my question is: All of those examples, always get those 'few files', lets say, one.html, two.html, and so, in the same folder where main.html resides; I want to achieve to have the 'some files' in a different folder, letīs say, /editors/ relative to the path where main.html is; Iīve done this, the ajax call works fine; the PROBLEM is that the xmlhttpresponse (consumed ajax text) wich is basically html 4, changes the links (hrefs) in those to the path of main, letīs say, for example, one.html has a link that points to itself, not an anchor, just a link pointing to itself as we often use for pagination of a grid, well, that link href attribute is changed to the path of the main.html file, and not preserving the original href attribute... why? where should I start from? changing the context parametere prior to calling ajax get?
View 1 Replies
View Related