Is there a way in HTML that I can make a unconditional jump to a fixed location like a goto statement? I checked the link command. But It must be triggered by a click. Thanks,
You can create a named anchor using the "name" attribute with the <a> tag and then link to the fixed location.
Doesn't make sense with HTML. It's not a programming language. It doesn't have a link command, though it does have a <link> tag (links other documents to the HTML document) and has an anchor tag (hyperlink to either other documents OR to another spot in the same document). What exactly do you want the page to do, and when? when the page loads?? When the visitor does something, but not a click?
My page has two parts: buttons and a table. Buttons allow selection of manufacturers. The table holds product information. Once a button is pressed, the control jumps to a local target to set up parameters and move on to fill up the table. The page has 20 cases to take care of as in the diagram below: <a name="T01"></a> ........ <a name="T02"></a> ........ <a name="T20"></a> ....... <a name="MAKE_TABLE"></a> I just want the control move to "#MAKE_TABLE" as soon as parameters are set.
This is definitely scripting, though it sounds like it might need to be a mixture of back-end (on the server) and front-end (javascript). I think when you say "control moves" you mean the focus. With HTML only certain elements can receive focus but with Javascript's onclick event, pretty much anything can receive focus (not all user agents tho, like IE6). These aren't HTML terms, so I'm not sure if you mean once a button is pressed, a script is envoked that fills a table with a particular manufacturer's details, or if "local target" means a form where the visitor chooses more options, upon which hitting Submit (which activates a script) fills the table with the appropriate information (grabbed from the server I assume). If parameters are being set manually by a visitor making selections from a form, the form's action (which is a path to the script doing the fetching) can also include a GET request like example.com/thepage#MAKE_TABLE, which in most browsers should move both the visual and the real (keyboard-accesible) focus. This will reload the page though, with a new URL which includes an in-page target. There are simple Javascripts that, when certain events occur, the focus is brought to a particular element (an example is the nasty AutoTab.js, used often in forms, where once the user has typed in x-number characters in an input, the focus is automagically set to the next input, often for things like credit card numbers where each set of numbers is always the same... it sucks because if you make a mistake you have to reach for the mouse to get back to the previous input... nasty). Users without Javascript will not have their focus moved, and won't see anything useful happening. If this is for an internal application then it's necessary to require all user agents involved have Javascript enabled (often stated in a contract). In any case, I'm pretty sure everything you want must be done with a scripting/programming language, and very little of what you want can be any default user-agent behaviour in HTML. All anchors require a click event to do anything, as do form submits. HTML doesn't understand anything as simple as "after x loads, move the focus here". If this product/manufacturer information is being pulled from a database, and the visitors are from Everywhen on the web (so possibly a number are without scripts enabled), then you may want to specifically look at whatever back-end language your server uses. If server-load is more of an issue, then you'll want to combine the back-end with some Javascript, for dealing with the browser and non-click events without page-reloading. Javascript can do things on many non-click events, while the server can only work with a script activated with usually a submit from a form, for example, which needs a click.
I think you're right on. I'm actually using PHP/HTML to write the website. Can PHP accomplish what Javascript does?
PHP has similar capabilities, but Javascript is (so far as I know at this point) the only language that a browser can run itself (well, actually I guess Java can too, not sure if it counts though as it uses its Java Virtual Machine so I think the browser doesn't do any interpreting but the VM does... and I'm not going to admit the presence of M$'s "JScript"). Javascript can manipulate the DOM (Document Object Model, made up of the HTML tags and their children, called "nodes") without page reloads. AJAX is pretty popular for this reason, and can save bandwidth because the Javascript is doing all the work without constant talking and GETting and POSTing with the server. Most modern browsers have a Javascript interpreter (Javascript engine) built-in, though not everyone has the same one. Not all user agents (which are not always browsers) can run scripts at all, and browsers come with ways to turn scripting off (NoScript is a very popular Firefox extension) for security reasons. IE is known for JS bugs, just like with CSS, it's missing some key things. It's considered Good Practice to build working document pages, using JS as an enhancement (an extra), so the page isn't broken without scripts (the page gracefully degrades, maybe works slower or looks uglier but still functions). Some people don't have the time to set up two different methods though, and simply require the user agent to allow scripts, or not work at all. So long as the user clicks a button (either a submit button or an anchor), there can be interaction with the server, which means the server can run any script you write in PHP. This always takes some more time and uses more bandwidth, because every time you make contact with the server you have the client asking for something, waiting for a response, and getting the response. A slow server would make a slow web page. However because the server is handling everything, the user agent can be very very dumb. Users can use Lynx and other text browsers, the cheapest PDA or mobile phone, the oldest screen reader or other assistive device, the dumbest dumb terminal, because it's not doing anything but asking and receiving. Also saves on battery life in your mobile/PDA, even little scripts run those things dry in no time. Another reason some users turn scripts off, they want to surf longer than 2 minutes : ) You might want to lay out a nice description of everything you want to do over in either the programming or Javascript forums, and ask first which technology makes more sense for what you're trying to do. Maybe also other forums entirely: in many places people just mindlessly say "do it all with Javascript, it's easy" without thinking about the implications of accessibility. Again if this is for an intranet or internal application you can kinda do what you want so long as your client has the technologies you require. The open web is something different though, esp. a "web page". No matter how fancy a web page might get, it's still a document, not an application.