cxbrooks / test

Second test for bugzilla to git
0 stars 0 forks source link

Javascript graphs #307

Open cxbrooks opened 12 years ago

cxbrooks commented 12 years ago

Note: the issue was created automatically with bugzilla2github tool

Original bug ID: BZ#509 From: Elizabeth Latronico <beth@berkeley.edu> Reported version: 9.1.devel CC: ptango@chess.eecs.berkeley.edu

Blocker for: BZ#508

cxbrooks commented 12 years ago

Add ability to create web graphics from plotters using popular open source Javascript graph packages

cxbrooks commented 12 years ago

-----Original Message----- From: Latronico Elizabeth (CR/RTC3.1-NA) Sent: Tuesday, June 12, 2012 12:56 PM To: 'Edward A. Lee' Subject: RE: [Ptango] Web server open issues

I like the HTMLPageAssembler!

I had some trouble getting Javascript to work properly in an HTML response. Originally I thought to supply a template page with some divs, e.g. ...

...

Then have HttpCompositeServiceProvider insert a chunk of Javascript in the that would run when the page is loaded and would populate the divs with content. That way HttpCompositeServiceProvider wouldn't have to read the file line by line and insert things. But, the Javascript wasn't executing properly - it looks like there are some restrictions on executing Javascript in a POST response: http://technify.me/user-experience/javascript/executing-javascript-in-an-ajax-response/

"It didn’t work. But why?

Simply stated, because the W3C Specification for XMLHttpRequest states:

“Scripts in the resulting document tree will not be executed, resources referenced will not be loaded and no associated XSLT will be applied.”"

Although, the current code in HttpCompositeServiceProvider used some Javascript in the response and it works - unfortunately I didn't save a copy of the code that was causing a problem.

To sum it it's probably possible to use Javascript but might take some tricks :) I think Javascript is a better approach if we can get it to work.

Best, Beth