I've been using the page [URL] as my guide to innerWidth/innerHeight, to resize an open browser window when the content switches from form A to form B. innerWidth/innerHeight appears to work in all non-IE browsers, but of this subset, non-Mozilla browsers seem to keep these properties read-only. And yes, I know Firefox, Opera, and others can disable Javascript resize of windows, but I would like to make this work as often as possible.
I have a website which displays photos. I want the photos to be resized depending on the innerWidth and innerHeight of the browser. I have my resolution set to 1024x768. So if you go to [URL] and click on 'Commissions' my 'w' variable in the URL contains 1024 but for some reason the 'h' variable displays 50. If I click on 'Commissions' one more time then it correctly displays h=602.
The problem is that i want to open a new window with the corect size in wich should fit a aaaXbbb px size picture!
The following isn't right: window.open("","height=bbb width=aaa" ) Because only the window will have the specified size and the picture will not fit inside!
An other option wich works under Netscape, Opera is the following:
Im trying to make a sticky footer and it works fine in all fo the browsers except ie, it wont add the needed height, when using height() it works but if i use innerHeight() it wont work, heres the code
Does anyone knows a method to measure the scrollbar's width, which works in Safari/Chrome.
The innerWidth function doesn't seem to take the scrollbar's width into account when measuring the innerWidth of the child element of a scrollbared element.
I'm having trouble with an overlay layer on a page I'm rendering on an iPhone, I'm trying to set it's height to the window.innerHeight but it doesn't appear to be working. I'm trying to do something similiar to a lightbox. I have element
My code is all about darkening out part of the browser window, making unclickable. I detect if the user is running IE, and if so, I don't use window.innerHeight because MS doesn't support anything. However, I have noticed an issue, and I believe it has to do with the "top" value. I've tried using window.screenY, but that didn't seem to solve my problem. You see, if you are running FF, it draws a box that starts in the top corner and only goes down as far as you can actually see on your browser.
Say you are scrolled down a little bit on the page, you can see the end of this box - it doesn't cover the entire page, only the part that is visible when the scrollbar is all the way up. I have included a picture to clarify what I'm talking about. The non-grayed out area is the area that would normally not be visible when the scrollbar is at the top. I would like to draw this box over the visible part of the page, no matter where you are scrolled. Right now, the box always draws from the very top of the page, even if that part isn't visible to the user.
I want to read a pre tag with xml. I am working client side. I have tried everything. The <title> tag gets lost with innerHTML(ok in FF only). I tried traversing the dom and putting in the tag names but the title tag is ignored. I am trying to syntax highlight this. Everything works if I do not use certain html tags. How do I get raw text from the pre? The text would come from one of two sources, a server or inputted into a textarea by the user. It is dynamically placed in the div tag and then processed.
I have a database with information of my users, lets say their date of birth.
I want them to be able to go to my site, and login with a username and password, after which they get to see what their date of birth is (according to what's stored in the database).
I want to upload a textfile named "userinfo.txt" structured like: <username>;<password>;<date of birth>, for example: "johndoe";"johnpass";"1985-11-25" "marydoe";"marypass";"1986-02-12"
What's the javascript to have a "username/password" box popup, and when a valid name/pass was entered show the appropriate date of birth?
I use Microsoft.XMLDOM load() method to load an XML file into memory and display some elements in the browser.
However it apparently locks the file, since I get this error message whenever a Visual Basic application concurrently tries to add an element to the same XML file:
The process cannot access the file because it is being used by another process.
I would like not to lock this file, but open it in read-only mode instead. In fact the browser simply needs to read its content, it doesn't need to modify it at all. As a consequence there is no reason to lock it.
At the same time, I need to access it from the VB process.
I have an external file, TestVar.js with a single line. NewsA("This is a test.","test.pdf","TEST")
Within my HTML I wish to use the array variables from TestVar.js, but can't seem to get them loaded for use. The following is what I have, but doesn't work. If I directly place the NewsA array in the script instead of trying to call it from the js it works just the way I want it, but I really need the external file. What am I doing wrong? Code:
I want to pass parameters thru URL. I know how to pass. I am finding problem in reading the parameters. here is the [URL]. how to to read these parameters from URL using java script?
I'm trying to read a cookie that I've set with php with javascript. The cookie is for storing the username when logging in to a site. If the cookie has been set I want the focus in the inline popup to target the password field so that the user doesn't have to tab down from the username field of the login form.
The php script stores the cookie perfectly: if (isset($_POST['remember'])){ $expire = time()+60*60*24*30; setcookie("login_username", $username, $expire); echo $_COOKIE['login_username']; } else { if (isset($_COOKIE['login_username']) || isset($_COOKIE['password'])){ $expire = time()-3600; setcookie("login_username", "", $expire); }}
The javascript: if (targetfocus == 'login_username'){ alert(readCookie('login_username')); if (readCookie('login_username') == 'username'){ targetfocus = 'password'; }} $("#"+targetfocus).focus(); ... function readCookie(name) { var cookieName = name + "="; var cookieArray = document.cookie.split(';'); for (var i = 0; i < cookieArray.length; i++){ var cookie = cookieArray[i]; while (cookie.charAt(0)==' '){ cookie = cookie.substring(1,cookie.length); }if (cookie.indexOf(cookieName) == 0){ return cookie.substring(cookieName.length,cookie.length); }return null; }}
But when trying to read the cookie in the javascript code I receive null when I put an alert to the code. Why won't the javascript find the cookie? Is it because I'm running the site localhost on my laptop? Does that have an effect on cookies?
While writing a look up for internet terms script for a site, I found the script will not read the second value in this array, I could make wl[1] a null value but would like to know what is happening if possible. All of the other elements seem to be ok!
function search(){ wl = new Array() wl[0]="applet - An Applet is a small application etc"; wl[1]="Bug? - Null but why"; wl[2]="cgi - CGI or Common Gateway Interface allows etc"; wl[3]="browser - A Browser is etc."; myWord=document.theForm.txtWord.value; myWord = myWord.toLowerCase(); for(c=0; c < wl.length; c++){ currentWord = wl[c].split(" "); alert(c + " MyWord " + myWord); alert(c + " Current " + currentWord[c]);// The alert box = 'Current -' when wl[1] is read. } }//end of function
Does anyone know how - or better yet - have a sample of how to extract information from a meta tag in an HTML document's head tag using Javascipt?
I have looked at the DOM with Firefox - but it seems so long. I'd be really interested in a better way. If someone has the javascript for walking through the DOM, that would be cool too. I havn't built it yet.
ok so I know how to do substring to read everything before a certain phrase however is there a way to read everything after a certain phrase? Ex of what this script reads and doesent read
Alex was slain by dog
Bob was slain by cat
Alex & Bob = "Var CharName" My substring reads this in this line: Var Charname CharName = msg.substring(0, msg.indexOf(" was"))[code].....
so 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.
I thought this would be simple for me to work out, but I can't seem to find reference to it. I'm flexable on how I call a URL, thus, if I have any one of the following:
How can I read the value to the right of the question mark?
I want to create a javascript function which reads the url, and, if the url was passed an arguement, it acts on it (namely, displays an error message)....
I'm having difficulty making a list (both drop down and radio button) read only; I am successful when I attempt to make a text field read only. Any suggestions on what java script I use to accomplish this?
If I have a link to a URL such as <a href="http://www.mysite.com/somecode.htm?5">Link1</a>, and if I include javascript in the somecode.htm file, is there a javascript command that I can use which will read the argument 5?
For that matter, is there anyway to send an argument to the javascript code of an html link you are calling. Server scripts are not an option for me.
For example, assuming that index.htm contains 50 links, I would like each link to point to the same html file, but I want that javascript code in that html file to execute something different depending on which link was clicked.
My only other alternative would be to create 50 similar html files which to me looks like amateur or bad coding.