laukstein / ajax-seo

Ajax SEO crawlable webapp framework with boosted UX

Home Page:https://lab.laukstein.com/ajax-seo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nested ajax calls

siva1117 opened this issue · comments

Hi,

The links inside the ajax loaded content is not working. I'm trying to achieve a sub navigation style,

For example lets say in your demo I have clicked on the about link and loaded new content for about page and replaced the content of the '#main_content" div.

The newly loaded content has some links in itself sort of sub links (like sublink1, sublink2, etc) and a new div called "#sub_content".

Now when the sublink1 is clicked i would like to replace the content of "#sub_content" div alone without ever disturbing the '#main_content" div.

I thought of using jquery live() or on method for the click event but i cannot, since you have written ajax call in the jquery address change() function itself.

Any help or tips would be great!, BTW this is a stunning frame work.

--Subramanian

Subramanian, thanks for posting the issue!
Since the issue is related to jQuery Address plugin, it would be great if @asual would participate too.

Issue summary: .address() event is not fired to Ajax loaded content.

Hi laukstein,

Sorry to ask you again but did you figure anything it seems to me that jQuery address won't bind on ajax-loaded content. I have posted an issue at jquery address and had no reply, so I was thinking of using history.js have you ever used history.js do u recommend it? Iam new to this whole ajax stuffs.

This issue is related to jQuery Address plugin and open also in asual/jquery-address#171
I am not sure if History.js https://github.com/browserstate/history.js is SEO friendly at all.

Hi thanks for the reply,

I was just playing with jquery address JS file and changed the line on 588
this.on('click', function(e) {
to
this.live('click', function(e) {

Now it seems to work, but I'm sure the .live() method has been deprecated since jQuery 1.7 and has been removed in 1.9 and the suggested replacement is .on method

Very strange it works with .live() method and not with .on() method

Anyway it seems we have to wait for @asual.

Update: I used jquery-1.9.1 with jquery-migrate-1.1.1

$(document).on('click', this, function(e) { is equal to this.live('click', function(e) { and has jQuery 1.9.1 compatibility, but unfortunately does not work with jQuery Address plugin.

I just pushed some updates for jQuery Address and also an demo for your case. Now your issue must be solved.