JQuery :: Get A Current Page Address?
Aug 12, 2010I was searching for this and found only: var local = window.location.href; Is there any other way to achive this?
View 5 RepliesI was searching for this and found only: var local = window.location.href; Is there any other way to achive this?
View 5 Replieshow to get the current url from the address bar?
I done a huge google job and found "location.href" I've got that displaying the url of the page which is not what I want I'm using dynamic url's in php so the ID at the end of the url will always change, So I want to use javascript to get the current url meaning that it'll inlude the ID and to click a link with that current url. I tried this:
Code:
document.write("<a href='"+location.href+"' onclick="share();">Share With Your Friends</a>");
I'm trying to create two bookmarklets:
1. Take the current URL of the page and open a new window with a URL based on the current page. Some examples (I use "->" to mean "this URL turns into that URL"):I plan to use these bookmarklets in sequence, first pressing 1 to log into the CMS, then pressing 2 to edit the current page.
My requirement is, I have multiple pages in tab format. If i am on first page in edit mode and change any control's value and without saving information i click on other tab that particular time a popup should appear showing validation message say "you are moving without save and it will loos all changes either click ok to loose the changes and move to other page or click cancel to remain on the current page."I tried using var isDirty = false; var msg = 'This page has unsaved changes.Click OK to abandon the changes and leave the page.Click Cancel to stay on the page so that you can save your changes.';
$(document).ready(function ()
{
$(':input').change(function ()
[code]....
how to post dat from curent page to another php page using jquery
View 2 Replies View RelatedExample when typing "change" into a textbox address change to: blah
View 6 Replies View RelatedOur company own a lot of domains and want to put a short page of copy on each address along with keywords before redirecting the user to our main site. I have been able to get the page to load the main site after the desired time using this code in the head...
<META HTTP-EQUIV="refresh" CONTENT="40;URL=http://webaddress.com/">
That works perfectly, I am now trying to display a countdown timer from 40 seconds down to 0, and on 0 redirect the user. Saying something like "You will be redirected in XX seconds". Is there anyway of doing this? I've been searching google for the answers with no luck and can only seem to find timers that countdown to a set date.
I've got 2 pages: a current events page and a past events page the current events page loads fine as there is only about 10 events the past events page takes about 30 seconds to load and will crash if u click your mouse in the loading time.
The pages are near identical the only difference is the query that selects the events (> versus <)
The page loads immediately without:
But when i put it back in the above happens. I'm using jQuery.roundedcorners.
In the menu in this page I have four different methods (you can see them in the <script> tag on the pages) of indicating the current page in a menu. I downloaded these from various web pages after Googling "jQuery highlight current page".None of the methods works. Is there something wrong with my selectors? Can anyone see why none of them are working?
View 4 Replies View RelatedI am trying to get the current page HTML URL (the one at the top in the address box) and place it in a variable.
[Code]...
I am using an ajax call to generate a new image with some text across it. How can I "replace" the image in the current page with the one I just generated, they will have the same name.
View 4 Replies View RelatedI am currently working on a page that has a series of <div> tags that .show and .hide whencorrespondinglinks are clicked, the first <div> is visible when you load the page. When you leave the page and return to it, the page reloads and the the first <div> is visible. Is there any way for the browser to save the current <div> that is visible to stay visible when you return to the page?example of what I am trying to accomplish:I load a page and click on the third link to show the third <div> and then after leaving and returning to the page (by clicking the browsers back button) the third <div> is still visible, rather than returning to the original state of the page where the first <div> is visible.
View 2 Replies View RelatedI'm trying to get the hover over image selected based on the current page. I've used an external jquery.url.js library to access file and href information. The if statement is reached correctly, but I can't get the code within it to work. Each image is stored within an anchor and, as with the hover code (included), I'm trying to change the end of its source file name from '_off'to '_on' so it's active.
$(function () {
$("img.rollover").hover(
function () {
this.src = this.src.replace("_off", "_on");
},
function () {
this.src = this.src.replace("_on", "_off");
});
$page = jQuery.url.attr("file");
$('#menu tr td a').each(function () {
var $href = $(this).attr('href');
if ($href == $page) {
$("img", this).src.replace("_off", "_on");
}});
My question if it's possibly to dynamical open (without hardcode URL)the same page (current page) in a dialog? I need to have a link on every every page in a site (the link lives into a template) and I need to open this page again in a dialog box with the same content.
View 3 Replies View RelatedBased on the lack of responses to the last hole (which I am attributing to one of the following:
a. The hole being too difficult,
b. It being overly time consuming, or
c. People not wanting to do it)
I have decided to take a step back for this hole.
Create a Javascript include function. This function should include a javascript file (when given a URL) into the current page assuming it wasn't already included in the page (either via the include function call or by HTML). If the file is already included the function should just return.
This function should either take a file name/ path to file or a full URL as a parameter. If it is a filename/ path the function should include the file from the base URL of the current site (such as [url]). If it is a full URL just include it.
Make sure you don't allow files to be included multiple times, we don't want that!
There is many examples of PageLoader's etc. in the web, but I can't find a script like facebook (and many other sites) uses. When a link is cliked -> user stays at current page and get's "Page loading" etc. notice until the next page is fully downloaded.In other words; When I click a link (Internet Explorer), I get first "a white page" until next page show's ..I want, that the page does not go white at all, but current page show's until the next page is fully downloaded.
View 3 Replies View RelatedI have page with an Ajax request which returns an entire <hml>..</html> page and I would like to use this response data to replace the current page. I wrote the following :
$.ajax({
type: "POST",
url: URL,
data: formData,
[Code]....
I've been trying to get some Ajax functionality on my rails app and have been stuck on this issue for a couple days... (new to jQuery!). My app has a form on the top of my site that acts as a search. When a user submits the form, they are redirected to a "search_users" page.
Rather than redirecting to a "search_users" page, I want the "search_users" page to load in a div called "page" on current page.. I was able to do this with my sites navigation (so when a person clicks on "home" or "about" or "contact me", nothing refreshes except a div called "pages") but not for the search form.
[Code]...
I'm trying to scroll/jmp to the #selected div on the current page before it runs the javascript below:
Code:
var hash = window.location.hash.substr(1);
var href = $('.workimg a').each(function(){
var href = $(this).attr('href');
if(hash==href.substr(0,href.length-5)){
var toLoad = hash+'.html #selected';
$('#selected').load(toLoad)
}});
$('.workimg a').click(function(e){
e.preventDefault();
var toLoad = $(this).attr('href')+' #selected';
$('#selected').slideUp(1200,loadContent);
$('#load').remove();
$('#work').append('<span id="load">LOADING...</span>');
$('#load').fadeIn('normal');
window.location.hash = $(this).attr('href');
function loadContent() {
$('#selected').load(toLoad,'',showNewContent)
} function showNewContent() {
$('#selected').css("opacity","0");
$('#selected').delay(50).animate({
opacity: 1,
height: 'toggle'
}, 1200, function() {
hideLoader();
});
} function hideLoader() {
$('#load').hide();
}});
How difficult would it be to do this?
I Need to get the URL of the page from the address bar and then retrieve a certain part of the url from that.
[URL]
I need to get the part after the # and only that part. How would I do this?
Ok, I want to make it so that page doesn't have address bar or menu bar but from within the page ( i dont want to have to make a link to the page so that it has to be in java in order to show the no menubar and no address bar )
so yeah, just to clearify that again, from within the page, i want to remove the address + buttons plus anything else (except the blue bar that holds the title and exit of course)
please tell me how to do this I saw codes for doing it through a java/text links but I want it to be a regular link and the code to be within the page, thanks a million in advance.
i want to add the link address when clicked on the link in web page to the outlook express address book when the outlook window populates. i tried to put
<a href="mailto:enquiry@mydomain.com" > click here </a>
but it only add address to the To section of outlook window, i want it should store the address in the address book.. of outlook express..
My source :
<html>
<head>
<title></title>
<script type="text/javascript">
[Code]....
I want after newtab is opened 5s, alert window will be opened with message:"Loaded complete". Then 2s it is closed. But it isn't what I expect.
I have a button in my site which when clicked, will set the current page to be the home page for the user. I use the following code:
var hiddenLink = document.getElementById('dummyLink');
hiddenLink.style.behavior='url(#default#homepage)'
hiddenLink.setHomePage('http://www.123.com');
somewhere in my <body>, I have the following link definition:
<a href="#" id="'dummyLink'" style="display:none"></a>
Now, this solution works fine for IE But I need to have a working solution for Firefox and Opera too. Does anyone know how to solve this in these 2 browers?
i want a make my web site the home page of the visitors who 'll visit my site....but i wanna do this without giving any message 2 them....i daont want them to know abt this....that on their visit my web site 'll become their home page.
View 7 Replies View RelatedI have been looking for a solution for a long time. I have embedded a SWF app in html page using SWFObject. Now I need to give the Flash app the address where it is currently embedded, since the same SWF file is embedded in more than one locations! So the Flash app is supposed to pull the right content according to its current position
View 9 Replies View Related