Re: Code for navigation



Sabine Dinis Blochberger wrote:
RedGrittyBrick wrote:

thulasibhaskar@xxxxxxxxx wrote:
In a web page with left navigation bar with tree view, i have 3 parent
nodes and for each parent node there are two children nodes,once after
loging to that web page , i have opened one children node and started
entering values in that form but in the middle if i want to open
another children tag i should get a confirmation message like"Do u
want to navigate away from this page?" , if i say ok it has to go the
requested Page or if have opted cancel button i should continue in the
same page.
So, Please help me how to write a function in javascript which has to
be called onClick.
Despite the similarities in name, Java and Javascript are two very different programming languages. People who know Java very well may not know Javascript.

I suggest you ask your question in comp.lang.javascript where I expect you'll get a better set of answers.

In your position, I'd buy a book on Javascript.

That said, the functionality the OP wants is not regarded as a good
practise - keeping (or trying to) people from navigating webpages is a
no-no.

In general I agree, but it sure looks to me like the OP merely wants to throw up a confirmation screen, and will allow the page switch if the user confirms.

I maintain several web applications where we do exactly this if the user elects to navigate out of certain situations. They stand to lose a lot of work if a mistaken click on a navigation tab suddenly puts them inside a completely different functional area of the application. It doesn't hurt to throw up a confirmation prompt.

AHS
.


Loading