Focal Point
[CLOSED] jquery and html5 graphs

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

September 23, 2013, 10:23 AM
jodye
[CLOSED] jquery and html5 graphs
Hi There

I am using jquery to post the results of a graph into a div. It works perfectly if the graph is a PNG but if I make it html5 (JSCHART) it does not work. I am using

   
 $.post('call to graph here',
 function(data) {
 $('#divname').html(data);
 });
 


obviously there is a conflict between the HTML 5 JSCHART rendering and the jquery code (I am using jquery 1.8.3 btw)

Anyone know how I can get jquery to play nicely with WF html5 graphs?

Thanks

This message has been edited. Last edited by: <Kathryn Henning>,


WF 8.0.0.5M
September 23, 2013, 02:54 PM
David Briars
Not an answer for you, perhaps something to think about..

I was working on rendering the results of a WebFOCUS report, within a div tag, using the
$(selector).html(content) method, in the same fashion as you are attempting to get a chart
to render.

In this one particular instance, I was getting errors in the browser, until I switched to writing to an iframe tag.

So the jQuery .post became something like:
  
$.post('call to report here',...
function(data) {
       //alert(data);
       window.frames["code_result"].document.open();
       window.frames["code_result"].document.write(data);
       window.frames["code_result"].document.close();
       }

...

<iframe id="code_result" frameborder="5" name="code_result" height=700 width=8000>
</iframe>

My preference would be to post to a div, but for this one particular report, I was having an issue.
September 24, 2013, 10:08 AM
jodye
Hi David

You are right.. it does work with an iframe!

I probably do need it to work with div though.

I have found the issue. There is a conflict with date.js that I am using for a jquery datepicker. If I comment out the date.js include then it works in the div.

I am playing with

jQuery.noConflict();

but no luck yet.

Thanks!

Jodye


WF 8.0.0.5M
September 24, 2013, 10:37 AM
jodye
http://www.datejs.com/

that is causing the conflict


WF 8.0.0.5M
September 24, 2013, 11:16 AM
Francis Mariani
It will definitely work in an iframe because the iframe is a new document. Something in the main document is conflicting...

So, you've tried noConflict?
$.noConflict();
var $$ = jQuery;


I wonder whether this will help: StackOverflow - Javascript Namespace Declaration.


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
September 25, 2013, 08:32 AM
jodye
you know what guys... I have to abandon HTML5 jschart anyway since the html5 graphs do not seem to work in IE8 and we need to support that. So I will be sticking with PNG.

Thanks


WF 8.0.0.5M