Moving The Current Focus On A Web Page With Frames Using JavaScript?
Jul 20, 2005
I am designing a website for disabled football supporters and because
of this, I obviously must consider accessibility to blind users whilst
I am producing it - as they are one of the disability groups that I am
targeting the page at.
The page basically consists of two frames; one being a vertical list
of links positioned on the left hand side of the screen and the other
being the main content pane, positioned in the remaining area of the
screen on the right of the first frame. The first frame is used to
drive the content of the second frame.
Now, I'm not sure if this is possible in JavaScript, or indeed in
another scripting language, but what I want to do is to be able to
alter the current focus or caret? on a web page when a link is
clicked. That is, when the user selects a link from the left hand
frame, then the new content is loaded into the right and the current
focus jumps straight to this new information, as opposed to having to
tab through all the same links again in order to put the focus there.
I know this is only a fiddly little thing but it is something that
would really improve the usability of the site, especially with screen
readers in mind.
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.';
as with document.title we can get the current page title,
<body onLoad="MM_goToURL('parent','script.php?title=document.title');return document.MM_returnValue"> this is the function I've used for that above trick
function MM_goToURL() { //v3.0 var i, args=MM_goToURL.arguments; document.MM_returnValue = false; for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'"); }
I have a quick question - if I have a form which refers to a javascript when its submitted using:
<form name = "fred" onsubmit = "test()">
and this function creates a popup window to display information in, I find that after the window has appeared, the focus moves back to the form and the text box used to gather user input clears. The clearing text box isnt a problem, but the moving focus is. Is there a way to make it so that the window containing the popup information stays on top? This problem doesnt ocurr when I use the submit button to call the javascript function.
I want users to work from a main application. Certain things will need to be done but the users wont want to see the main screen go away while doing these certain things. So my idea is to just open a new window with the content they need, they'll make their changes, the new window will close but then I want the main page to reload.What I've done now is at the end of the script that will be run prior to the new window closing is added this (its a php app):
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.
i have a frame on my website that displays some information. I want to have a button/link that when users click, it will make that frame 100% width and height.
How can i do this?
I think this is done with javascript.
Also another question i have is:
I am including a webpage in the frame, how can i make it so it cuts off say the top 300 pixels of the target webpage?
I am pretty new to Javascript and have only created a few pretty basic scripts, mainly dealing with site navigation and mouseovers. I would like now to redo my private home page using a rather complex configuration of frames. It is my intention to use JavaScript (variables) to control the rather intricate page navigation.
My question is this. I know how to define a variable, increment or otherwise alter it's value and how to change a process path based on the value of a variable. I have done all of this within the SAME page. What I would like to know more about is the referencing and modification of variables in "pages" in other windows within a frameset.
There are tons of examples how to break out of frames with Javascript and I thought you couldn't do it without Javascript.
But YAHOO! does it! If you place www.yahoo.com inside an iframe and click on an item in the Navigation (say Autos) it breaks out of the frame even if Javascript is disabled in the browser. Works for both IE and Firefox.
The page redirects with a Location header a couple of times, but I tested that and it's not what is causing it to break out. To test simply create an html file on your desktop with the following contents: Code:
I try to print out five hidden frames throug a printing-form. I use the frame.focus() and the frame.print() functions. Everything is fine except the following little disadvantage:
When I print out the five frames, the print window dialog appears five time (for each frame once). The user has to confirm his standard printer several times.
I have a DHTML Folder Tree, also known as a TreeView. That is, an expandable/collapsible tree of links. In a frame-less layout everything works great. In a frame-based layout, it doesn't work on Safari/Konqueror.
There are two frames: the left frame contains the tree control; when you click on a link in the tree, the right frame is the target for the links in the tree.
The tree mechanism itself works fine. But there is a problem with the links. What happens on Safari/Konqueror with the frame-based layout is the first link works fine, but all links after that do not. That is, the first click loads a picture on the right frame, but when I click on any other links after that, the target frame is not updated.
I have a page with two frames, 'header' and 'main'. The following code works in Netscape, but in Internet Explorer. The second bgColor line produces an error:
function test(){ top.frames.header.document.bgColor='white' //works fine top.frames.main.document.bgColor='white' //fails }
I work for a financial company. I am planning to give a presentation to rest of the development team (15 people) here on moving server side logic to client-side javascript for an internal intranet application rewrite. This approach will definitely stir up hot debate from hardcore server-side Java folks who wants to do UI stuff even on the server!. Since I am pretty much known as the JS or UI Guy of the group, my Boss wants to hear the broad spectrum of PROs/CONs from each proponent.
Personally, I think Javascript/Ruby is a more productive language than Java.
My idea is simple. It is to convert most business logic to client- side javascript and have calls to server-side code restricted to user roles with data validation. Thats as simple as it gets.
Here are my list of arguments
1. True separation of UI logic from server-side data processing code (no more server code spitting out client-side code) 2. Better user experience with faster response 3. The whole web 2.0 thing (no page refresh) :) 4. Offload client processing from server therefore reducing network traffic (not really a strong argument is this?)
Keep in mind this is an internal app. Even if someone figures out the JS logic behind the page and try to hack the app by posting to Servlets, they will be restricted by their login role, and data validation will take care of any bogus data being submitted.
consider the senario for example if i am taking some input from user on my page and checking that the input should be a number for that imake a script shown below which is working fine Code:
so that the top frame acts like a dedicated browser. The top window controls a selection of links pages in the lower screen. The pages linked to will appear in the lower window as well.
I have already created the frames pages using FrontPage, I just need to fill the whole screen with it and I want it set with the usual buttons found in the upper right hand corner so people can shrink it, enlarge it or close it. And I guess I'd need a foward, back, and refresh button in the top frame as well. Can anyone tell me how or if this can be done?
For my application I had developed one page that is having more fields at the of that page I am displaying some records and to select those one check box for each record. If user clicks on the select all link it has to check all the records, I am using java script . At this time screen moving to top, to see weather records are checked or not again browser has to scroll down.
I have an instance where I do some work in a page contained in an iframe and then need to either outright move or just copy the resulting page elements into the parent page. All of the back end stuff works fine, but the Javascript just runs and doesn't produce anything. The script in question:
Code: var AddressListDiv = parent.document.getElementById("AddressListDiv"); var ListPanel = document.getElementById("ListPanel"); for(var LPC = 0; LPC < ListPanel.childNodes.length; LPC++) {
[Code]....
I think I'm running into a restriction in Javascript, but I'm not 100% sure.
Based 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!
a very draft code, what i wanna do is when i click on the form, the value will auto be selected. but i cant seem to do so, and i am not very sure of the problem.