Monday 15 June 2015

javascript - How do I do ajax navigation on pageload? -


I have several reports that have been created through AJAX calls. I am prototype.js framework on this page for some function functions.

Links to each report are # anchors / tags such as Report 1, # Report 2, etc., which are lots of onClick functions to create reports through Javascript.

I would like to do this, if a user bookmarks a page with a link or navigates directly with an anchor / link in the url for my page to load the report.

So if the user goes: It should load the page and go to another report.

Anyway in my paglod can I see the anchor / link onlcick for that anchor? I was thinking that I can make a big case / what the statement is to do, but maybe it was a simple way.

It all depends on you how Ajax calls are really structured. I do something similar to open the right tab. The code will start in this way, if you see how your Ajax events have been tilted, then I should be able to show you the rest.

  document.observe ("dom: loaded", function () {if (window.location.hash) {var report = window.location.hash.replace ("#", " );}});   

Edit

By looking at your code, you want to better switch on (IMV) an irrelevant method where you get the element eg

  $ ('ele'). Inspect ('click', dust stop.bindseuse listener ($ ('ele'));  

This enables you to connect the same functionality easily with one click or a pageload, but does better practice anyway and prevents code repetition etc. Obviously this is missing in large amounts but hopefully what you want me


No comments:

Post a Comment