Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...Google Charts JavaScript and DNN 7.xxGoogle Charts JavaScript and DNN 7.xx
Previous
 
Next
New Post
3/17/2014 2:18 PM
 

Hi, fellow DNNers

I promise, I've spent a few hours trying to solve this riddle on my own before posting here, but everything I've found and tried through Google hasn't quite matched the situation I'm experiencing.  (I know, everyone says that, right?)

I've got a pie chart that was done up in Google Charts on a static HTML page, and we're trying to insert it into a DNN page. it's basically an externally linked JavaScript library that creates SVG output in response to user defined data structures that are done via inline JavaScript.  

(At first, I did have an issue with DNN stripping out my JavaScript, but after some Google searching I figured out the whole Text vs. HTML editor issue. So I managed to get that part figured at least.)

Here's the peculiar bit-- it acts as though none of my JavaScript is present, but I can see the Google chart script link and my inline JavaScript when I use "Inspect Element" in my browser.  It definitely isn't being removed or filtered out.  It looks like the script tags and their contents are getting minified into single lines, but that shouldn't present any issue because I've got terminating semicolons in place.  

When I check the console for errors, I'm seeing this message:

Uncaught SyntaxError: Unexpected end of input Default.aspx:699 

Uncaught SyntaxError: Unexpected token < Default.aspx:699

Line 699 isn't one of my JavaScript lines, though.  It appears to be this:

<span><span onclick=" return dnnModal.show('http://hvtechnologies.com/TestsTrack/tabid/389/ctl/Edit/mid/1132/Default.aspx?popUp=true',/*showReturn*/true,550,950,true,'');"><input type="image" name="dnn$ctr1132$dnnACTIONBUTTON1$ctl00$ctl00$ctl00" title="Edit Content" src="/images/edit.gif" alt="Edit Content">&nbsp;<a title="Edit Content" class="CommandButton" href=" __doPostBack('dnn$ctr1132$dnnACTIONBUTTON1$ctl00$ctl00$ctl01','')">Edit Content</a></span>&nbsp;&nbsp;</span>

It's almost like my JavaScript has an extra/invalid opening bracket, but I've copied and pasted the whole HTML output into my editor to check it with color-coding syntax, and nothing seems to be triggering it there.  

Is there some quirk to getting Google Charts' JavaScript to work with DNN that I'm not aware of?  

Or maybe the HTML module isn't the right tool for the job?


 
New Post
3/17/2014 6:43 PM
 
whilst you can usually hack a solution in via the html module, it's easy to make mistakes. Typically someone would do this via adding it to the skin or container, or else adding it via the page header field (in page settings), or using a 3rd party module such as https://wnsinj.codeplex.com/ to inject the js, and then use the html module to host the markup

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
3/18/2014 12:21 AM
 
three things to look for - a missing script tag opener or closer - a missing { or } or the most common a missing " or ' or a mismatch of those - if there is a " or a ' inside a script it must be closed - or nothing else of the page will be seen until a corresponding ' or " is found. even a close /script will be ignored if the the system thinks its inside " or ' string

Westa
 
New Post
3/18/2014 9:37 AM
 

Good morning, and thank both of you for your replies.  

Didn't know I could use Page Header Tags for things other than meta tags.  I'll have to research that further.  Trying to avoid putting it in the skin at this point because the JS is unique to this specific page.

I think Wes is right, though.  There's got to be something in my JavaScript (mixed quotes? GT operator?) that is somehow getting prematurely interpreted as a tag closing . . . and then when combined with the DNN JavaScript, it breaks everything below that point JavaScript-wise.  It's odd my IDE isn't picking it up when I copy and paste the output into it, though.

Let me remove the JavaScript entirely, and then add it back in one function block at a time, and see if I can pinpoint where the glitch is happening.  Thanks again for your advice.

 
New Post
3/18/2014 10:30 AM
 
Well, I think I've found part of the issue. I literally couldn't add even the first "block" of JavaScript without creating that same error again.

I even tried a simple Hello, world!") test, and that was causing it too. (I didn't have the CDATA piece at first, but added that after I studied the other JavaScripts I saw DNN was generating. You know, when in Rome, etc.)



It looks like DNN converts the line breaks into
tags when I use the text editor inside the HTML module, and those
tags are playing havoc with the rendering on the client side. That's really odd because the output I was seeing yesterday put all the JavaScript in a single, long line. But even if I did remove all the line breaks manually, that's going to make it a nightmare to maintain/update.

So it looks like putting the JavaScript in the actual HTML module is a no-go for me. Time to investigate the page header field option, I suppose.
 
Previous
 
Next
HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...Google Charts JavaScript and DNN 7.xxGoogle Charts JavaScript and DNN 7.xx


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out