PDA

View Full Version : [SOLVED] Ext Docs History works (browser back button), my doesn't. Why?



jsakalos
21 Jun 2007, 6:58 PM
I'm trying to implement Google Search. I have search form in InfoPanel and search results in iframe in the center region.

I create the search URL in the Search button handler and then I activate search results tab and I set the src attribute of the iframe. I thought this is exactly how Ext Docs is done but it's not as browser back button works in Docs but it doesn't for me. (In Opera it does, maybe also in IE but not in FF.)

I searched forums and net and I tried also location.replace() method in vain. The showcase is here (http://aariadne.com/accordion).

What am I missing? What's different from Ext Docs?

Thanks,

aconran
22 Jun 2007, 11:30 AM
If I had to take a guess I would say it's because Docs use anchor tags. The browser probably adds it to the history since its an actual link. Are you using an a href tag?

jsakalos
22 Jun 2007, 1:05 PM
If I had to take a guess I would say it's because Docs use anchor tags. The browser probably adds it to the history since its an actual link. Are you using an a href tag?


Hmm,

I'm quite not getting it. Here are parts of docs.js that does it:



tree.on('click', function(n){
if(n.isLeaf()){
Docs.loadDoc('output/'+n.attributes.fullName+'.html');
}
});

// ....

loadDoc : function(url){
Ext.get('main').dom.src = url;
}



Where click handler just takes name, prefixes it with 'output/' and appends '.html' and loadDoc method just sets src attrib of iframe.

What I do is same only the url contains also arguments (name=value&name2=value2...) and the url is complete with http://www.google.com/custom?....

I'll further investigate this.

jsakalos
22 Jun 2007, 5:18 PM
I've finally solved this and I'll report later how.

jsakalos
23 Jun 2007, 3:05 PM
The problem here was that there were another iframes created by Google adSense scripts on this page. Their script uses document.write to create iframes.

The solution consists of two things:



Let adSense to create their iframes first
autoCreate search results iframe afterwards


You can see result here (http://aariadne.com/accordion).