Focal Point
[CLOSED] jquery + permission denied

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3787026626

November 27, 2012, 03:24 PM
Daniele Barone
[CLOSED] jquery + permission denied
Hi,

I hope someone have an idea on how to solve this issue.


I am trying to create a nav menu that load html pages into a div section. The main page looks like:



title: Load HTML pages into a DIV


Div section:
(when I click one of the above link, the corresponding html page is loaded in this div)

here the code of the main page:

 


<!DOCTYPE HTML>
<html>
	<head>
		<title>Main page</title>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<meta name="description" content="" />
		<meta name="keywords" content="" />


<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
<script>
 $(document).ready(function() {
  $('#nav a').click(function(e) {
   e.preventDefault();
   $('#content').load($(this).attr('href'));


  });
 });
</script>
</head>
 
 
 <body>  
<header>
            <h1>Load HTML pages into a DIV </h1>  
			
	
</header>		
			<nav id='nav'>
					     
			<ul>

       						[*]DUMMY PAGE (working)
		
							[*] COMPOSER PAGE
      
					      </ul>
			 
			</nav>
 
	

<div id='content' >
My stuff
</div> 


</body>  
</html>  


 



Now, for a simple dummy page(see first code below) everything works like a charm. Instead, for a page created with composer (second code below) I got the following error:

jquery.min.js

Error: Permission denied


Using the IE debugging, it stops at the following highlighted part in the jquery.min.js ( exactly, line:2 character: 69205)


v.each(l,function(e,t){t.src?v.ajax?v.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):v.error("no ajax"):v.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Tt,"")),t.parentNode&&t.parentNode.removeChild(t)})}


I tried to google the type of error but I had not luck. Moreover, I am kind of newbie with jquery, html5, and Information builder products so I am really looking for some suggestions.



DUMMY PAGE CODE

 

<!DOCTYPE HTML>
<html>
	<head>
		<title>Dummy page</title>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<meta name="description" content="" />
		<meta name="keywords" content="" />



<style>


</style>

    <body>  
        <header>  
            <h1>DUMMY PAGE </h1>  
        </header>  
			<article>

			<p>It works!!!</p>
			</article>

    </body>  
    </html>  





here is the code for a simple page created with the composer. I think the issue is related to the script: <script id=IBI_ibigbl type=text/javascript src="/ibi_html/javaassist/ibi/html/js/ibigbl.js">. If the page does not link such a script, everything works fine, but I bet the script contains a lot of code necessary for the pages created with the composer to work.
Thanks a log for your suggestions



COMPOSER PAGE CODE



 


<!DOCTYPE HTML>
<HTML>
<HEAD>
<META id=mycharsetmeta content="text/html; charset=ISO-8859-1" http-equiv=Content-Type>
<META id=Generation content="Created in release 7703, Generation 3.0">
<SCRIPT id=IBI_RelCallBack type=text/javascript>function AdjustChildrenPosition(){
}
</SCRIPT>

<SCRIPT id=IBI_OptionsScript type=text/javascript>
var cgipath = "cgipath";
var ibirls = "ibirls3";

var rltdyncalendar = "rltdyncalendar";
var gmap = "ibigmap";
var olap="olap";
var olappanebase="olappanebase";
var olapdrill="olapdrill";

var ibixmltree="ibixmltree";

var ibiOptions = new Array(cgipath,ibirls);
</SCRIPT>

<SCRIPT id=IBI_nls type=text/javascript src="/ibi_html/javaassist/nls.js"></SCRIPT>

<SCRIPT id=IBI_nlsVars type=text/javascript src="/ibi_html/javaassist/nlsvars.js"></SCRIPT>

<SCRIPT id=IBI_ibigbl type=text/javascript src="/ibi_html/javaassist/ibi/html/js/ibigbl.js"></SCRIPT>




<SCRIPT id=IBI_ibigblloadCss type=text/javascript>
ibigblloadCss(null);
addIntlTranslatedJS("composertrans.js");
</SCRIPT>






<TITLE>HtmlPage</TITLE>
<SCRIPT id=clientEventHandlersJS type=text/javascript>
//Begin function window_onload
function window_onload() {
 
UpdateData();
 
// TODO: Add your event handler code here
//add onInitialUpdate() function to make changes before initial run of the reports
}
//End function window_onload
</SCRIPT>

<SCRIPT for=window type=text/javascript eventname="onload">window.onload = function() { window_onload(); }</SCRIPT>
</HEAD>
<BODY style="OVERFLOW: auto" thumbnailscale="4" elementtype="21" edaconnectionrequired="false">
<SPAN style="Z-INDEX: 1; POSITION: absolute; WIDTH: 100px; HEIGHT: 19px; TOP: 120px; LEFT: 190px" id=text1 tabIndex=1>COMPOSER PAGE</SPAN>
<INPUT style="POSITION: absolute; TOP: -100px; LEFT: -100px" id=layoutinfo type=hidden>
<INPUT style="POSITION: absolute; TOP: -100px; LEFT: -100px" id=ibiapp_app value="...." type=hidden ismre="1" name="ibiapp_app">
<INPUT style="POSITION: absolute; TOP: -100px; LEFT: -100px" id=ibif_ex value=app/ibipage.htm type=hidden name="ibif_ex">
<INPUT style="POSITION: absolute; TOP: -100px; LEFT: -100px" id=IBIMR_domain value=mydomain/mydomain.htm type=hidden name="IBIMR_domain">
<INPUT style="POSITION: absolute; TOP: -100px; LEFT: -100px" id=IBIMR_folder value=#myfolder type=hidden name="IBIMR_folder">
<xml id=focus_xmlelement>
<script type="text/xml">
<rootxmlnode focoption="_FOC_NULL">
<variables></variables>
<input_controls></input_controls>
<other_bound_objects></other_bound_objects>
<requests></requests></rootxmlnode></script>
</xml></BODY>



<SCRIPT id=IBI_loader type=text/javascript>
doBeforeLoad();
</SCRIPT> 


</HTML>



 

This message has been edited. Last edited by: Kerry,


WebFOCUS 7.6
Windows, All Outputs
November 27, 2012, 04:02 PM
Francis Mariani
Daniele, I have reproduced the problem in v7.7.03 and can't find a solution. It's a little strange.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
November 27, 2012, 04:37 PM
Daniele Barone
Thanks Francis for your reply.

it is all the day that I am trying to figure it out, but until now I had not success Frowner

any help or suggestion it is much appreciate Smiler


WebFOCUS 7.6
Windows, All Outputs
November 28, 2012, 01:02 AM
jamesr
The permission denied error usually pops up when you are using a .load() that inserts content that references scripts or files outside of the page's domain (You can't load cross domain content with an ajax call), but this issue looks to be caused by the inserted content attempting to load files with the wrong path.

When I loaded up your example and started looking at the requests and responses, there are a lot of 404 Not Founds when the composer page is inserted. This seems to be caused by the IBI JS files including their helper files/libraries with relative paths. When you load this into your page, this Composer JS file is looking for its helpers relative to your page location, not the location of the Composer JS.

So requests are going out for files like:
http://localhost:8080/ibi/html/js/ibijsdbg.js

When they should be going out like this:
http://localhost:8080 /ibi_html/javaassist/ibi/html/js/ibijsdbg.js

The quick fix would probably be to create an iframe object and set its src to the link href and add this to $('#content').html();


WF 7.7.03 on Windows
November 29, 2012, 02:02 PM
Daniele Barone
Great I will try it.
You guys rock!!

By the way:


is this the right way to link a page in the same MRE folder where the calling page is(i.e., both the main page and the dummypage are in te same folder "my folder")? or another way is suggested?


  • DUMMY PAGE (working)


  • Thanks for all your help


    WebFOCUS 7.6
    Windows, All Outputs