If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

jQuery after prompt page makes for a script error

Started by navissar, 30 Oct 2012 01:58:14 AM

Previous topic - Next topic

navissar

This is weird, and I wanted to see if anyone else has encountered that:
When adding jQuery to a report, if the report page contains a prompt page and at least one date prompt, browser (IE8) returns a scripting error (Object dosn't support this property or method) from prmt_core.js. This happens even if all I'm doing is calling jQuery in, without any further use.
I'm guessing there's some collision between jQuery and one of the JavaScripts that are in charge of creating prompts, but I wanted to make sure this isn't environmental - anyone else has seen this? I'm on 10.1.1.

I should note that I have found a workaround. In case it's not just my environment and for the people from the future, stumbling upon the same issue, here it is:

I figured this happens because of some sort of a coliision between the JavaScripts which creates the prompt and the jQuery. Basically, we want to allow the prompting scripts to finish their due course, and then to load up the jQuery. Here's a method for calling jQuery with a delay - jQuery will only load once the page has been fully loaded:


<script>
function loadJQuery(){
var head= document.getElementsByTagName('head')[0];//html page head
var script= document.createElement('script');
script.type= 'text/javascript';
script.src= 'https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js';
//make a new variable the same way for jQuery UI if you use it
head.appendChild(script);//call jQuery
}
function onLoad(){
if(document.readyState=="complete"){
setTimeout('loadJQuery();',50);//just to be safe
}
else{
onLoad();//recursive
}
}
onLoad();



</script>






jpecore

I had the same error, but your fix only works for the first time an item is selected from the prompts. The second time you try it gives an error.


These solutions both worked for me:

http://jajalc.wordpress.com/2010/10/13/cognos-with-jquery/

http://www-01.ibm.com/support/docview.wss?uid=swg21429438