Obtaining The Current Url
Mar 13, 2006I need to use javascript and get the current url which is being used in
firefox and pass it on to another script. Can someone help me out with
it? Plz pass on the required code if u do have it.
I need to use javascript and get the current url which is being used in
firefox and pass it on to another script. Can someone help me out with
it? Plz pass on the required code if u do have it.
Is there anyway to obtain the width of the scrollbar? I've tried
var sb = document.body.offsetWidth-document.body.clientWidth ;
but this does not appear to be correct.
My HTML is shown in an iframe. There is a link in the HTML that needs
the ID of the iframe to be used in the onclick event. How do I get it?
I tried accessing the target property, but it turns out to be
undefined. Also I do not know the frame number in the parent's frame
collection. SO I cannot do parent.frames[2].id.
I just wanted to know if there was any way to use script to display a
list of methods linked to a particular object? The object I have in
mind is getBrowser(), and I can't seem to find any documentation online
with regards to it's methods.
Also, as I am learning, it would be nice to be able to know what
methods are available for a particular object/function, without
necessarily having to spend a while looking up an object's method when
it's documented in a lot of different places, but only vaguely.
i've been trying to figure the best method to achieve obtaining siblings between specific selectors. Let me be concrete with an example:
...
<tr class="rowTypeA">
...
[code]....
I'm playing around with the facebook API with very limited knowledge of JavaScript, and I was wondering how I could use the FB social graph to extract user interests and display it on my site. I have the authentication set up, but I'm not sure how I would retrieve the interests, which is a JSON array.
Here's my code so far
FB.api('/me', function(user) {
if(user != null) {
//create image variable and getting image
[code]....
I'm not sure how I would get the movies and display the information- I know what I did isn't right since "movies" is an array...
The page will display brief instructions followed by a table containing the quiz.The first is with the Score() function which reads as follows:
function Score(){
for(i=1;i<=10;i++)
if(ans[i]== yourAns[i])
[code]....
Now unless I'm mistaken (which I am since the score isn't being tabulated correctly) this function essentially uses a for to cycle through both arrays, comparing the user's input against the array containing the right answers. If the contents within index i are the same on both arrays the score increases by one point. Once it cycles through the arrays, it passes score over to prequiz.score.value which will later pass this number to the text box that will display the grade to the user.
Thinking it was the setAnsArray(question, answer) function I added a document.writeline to it. However it showed that the values were being passed correctly to the answer array. Added a document.writeline to the Score() function. Unlike the point above, score always displays as 00000 regardless of how many right answers I provide.
The second issue I'm having is that the reset button is not working correctly. If I hit reset and answer the first question, the score will come back as double the score displayed before.
<?xml version="1.0" encoding= "utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
[code]....
I have the following html code:
Code:
<form name="temp" method="get">
<select name="name"
<option value="10"selected>10</option>
<option value="25">25</option>
<option value="50">50</option>
</select>
</form
when a change in selection is made, I would like to obtain the form element in the f() function.
I know that it can be done using the form name or index.
I am looking for a way to do it via the <select> element itself.
Something along the line of:
Code:
is this possible? a browser compatible method is prefered
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.
How can i add div above the current div?
Code:
<html>
<head>
<title> "Javascript Testing"></title>
<style type="text/css">
[Code].....
The function below should work, but I would like to know how to get the to
display at a specific area on a website. Can sombody tell me how to make
use of this function. I have it pasted in the right area of my website
(head section) and I'm sure it is loading when the page loads, but not sure
how to execute it.
function getTime()
{
var tNow = new Date()
return tNow.toLocaleTimeString()
}
I have the following...
<table>
<tr>
<td>
Test
</td>
<td>
<a href='NEEDCOEHERE'>delete row</a>
</td>
</tr>
</table>
How could I delete the current row that the href is a part of? I would
like to try to stay away from using IDs.
How do you simply output the current url in the browser i.e if i am in google.com I want google.com outputted and so on.Also on multilanguage sites if my url is say www.mydomain.com/en/about.html or www.mydomain.com/en/animals/horses/racehorses/stallions.html I want to be able to manipulate the url so I can change en to fr for example when I jump between english and french pages. I want users to be able to switch the language of that particular page by clicking a link. I need to be able to switch segment one of the url (en,fr,de etc...)dynamically somehow instead of hardcoding a link into each page.
View 2 Replies View RelatedI am trying to find a way to create a hyperlink that includes the URL of the current page as a query parameter, eghttp://website.com/ref?url=http://mywebsite.com/thispage.htmwhere the bit in green is generated from the URL of the current page rather than hard-coded into the HTML. The reason for this is that I am putting it into a page fragment to be called up with a virtual include and will appear on hundreds of pages, so I really don't want to have to hard-code the link every time!I don't use PHP or any form of CMS, so I think my best bet is to use Javascript (it's a non-critical function so I am not too worried if it fails for people without JS enabled). I think I could probably cobble something together using document.write but I suspect there is a better way of doing it.
View 1 Replies View Relatedso I'm interested in knowing if there's a way through javascript, php whatever to be able to read the pages current URL. For example when the page loads and knows the difference between www.mySite.com/ and www.mySite.com/#aboutI'm trying to find if there's a way to use the '#about' as a variable for a particular script instead of just it being dummy text on the end of the URL.
View 3 Replies View Relatedhow 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 have a script that needs to see the current opacity value of divs but I can not find the code to make it work in IE. I've googled it for over an hour with no answer. For non-IE browsers, here is the code I am using div_opac = document.getElementById(some_div).style.opacity;
View 6 Replies View RelatedIs it possible to use javascript to get a list of files from the current
directory where the html page that contains the javascript is being called?
The reason is that I want to find all ".jpg" files in the current dir and
randomly display one. Right now I am manually putting each file name in an
array element, very hard to maintain.
I have to insert a button in the left of all record in a table to print the
current record, simply create a table and print it in the printer.
anyone have an idea or there is a printer/report utility.
How do I capture the current URL to a string? What I want to do is
press a "submit" button that takes me to whatever URL is present in the
address bar of the browser.
I have done this simple function, it seems to work as intended, to
solve a problem i have had for a while. I couldnt find any sample
around that was working for me.
It should be fast and if possible compatible with todays modern
browser-standards. It should be activated by the onload-event. Code:
I need to use a lot of progressbar in a html page, to handle each progressbar I am using a bar_id (each progressbar has a different bar_id):
<div class="progressbar<%= bar_id %> "></div>
<script type='text/javascript'>
$("div .progressbar<%= bar_id %>").progressbar({value: <%= val %>});
</script>
[Cod].....
but it doesn't work.
I have a navbar numbered 1 thru 6 for a slider. You can see it here. [URL]. Is there a way to have the current navigation number share the rollover state? In other words, if I slide to #4 then the actual navbar #4 displays in a different color until I navigate away from it. I originally thought that this would be a simple CSS thing, but that idea went more towards javascript 'test'. Then I wondered if there might be a plug-in for this sort of thing.
View 11 Replies View RelatedURL...This item is almost finished for a project.I've gone over ita few hundred times.Each time a tab is selected, it goes to thecorrect <p> paragraph and displays the paragraph assiged to that tab, but that tab orcurrent tab does not stay ON.
View 1 Replies View RelatedI thought this would be pretty easy, but a Google search on it had a bunch of advanced things. I simply want to have an event response on a anchor tag that returns the position of the cursor onClick.
So:
<a href="javascript:void(0)" onclick="position()">here</a>
Where, when you click "here", you alert the position of the cursor (using screenX an screenY, if I read it right). But I'm seeing things about registering events to the .document, etc., but no easy solutions. The ones that look easy say that you need to "pass the event" through the function, but they never say how.
I wanna scroll the page to a specific location at the bottom. I can get the position of the destination, but how can I know where I am on the page? I need to scroll the page from the current location to the destination slowly not at once, is that possible?
View 2 Replies View Related