Skip to main content
Participant
September 27, 2011
Question

history.back() doesnt work when calling from html javascript

  • September 27, 2011
  • 1 reply
  • 1224 views

I'm working on air app (html/ajax/javascript). I need to make a navigation feature, like a browser back and forward button in a page with iframe, all pages are on same domain.

I have the following scenario:

Adobe AIR (version 2.7.1) app that loads (air.HTMLLoader) index.php from mydomain.com

http://mydomain.com/index.php file has following design:

<html>
   
<body>
        <input type="button" value="< BACK" onclick="iframeID.history.back();">
       
<input type="button" value="FORWARD >" onclick="iframeID.history.forward();">
       
<ul>
           
<li><a href="http://mydomain.com/page1.php" target="iframeNAME">page 1</a></li>
           
<li><a href="http://mydomain.com/page2.php" target="iframeNAME">page 2</a></li>
       
</ul>
       
<iframe src="http://mydomain.com/page_default.php" id="iframeID" name="iframeNAME"></iframe>
   
</body>
</html>

So, this code works in FireFox, Chrome, Safari, but not in Adobe AIR app

I can't find any documentation about this issue, really cant understand where is the problem, as i know adobe air uses webkit for web pages browsing like chrome and safari but only in air app this code doesnt work.

I hope someone can help me.

Thanks!

This topic has been closed for replies.

1 reply

chris.campbell
Legend
September 28, 2011

My hunch is you are running into a security related restriction.  If you haven't already, please take a look at the following pages:

HTML Security in Adobe AIR

Cross-scripting content in different security sandboxes

If this doesn't sound applicable, let me know and I'll forward this to our webkit team.

Thanks,

Chris