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

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...embedded javascriptembedded javascript
Previous
 
Next
New Post
3/23/2009 8:11 AM
 

Hello,

I want embedding javascript in my module (LightBox2   http://www.lokeshdhakar.com/projects/lightbox2/)

<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="js/lightbox.js"></script>

 

My path (JavaScript)

/DestopModules/MyModul/javascript

MyModul.vb (Page_Load)

Page.ClientScript.RegisterClientScriptInclude("lightbox", "/DestopModules/MyModul/javascript/lightbox.js")

Page.ClientScript.RegisterClientScriptInclude("lightbox", "/DestopModules/MyModul/javascript/prototype.js")

Page.ClientScript.RegisterClientScriptInclude("lightbox", "/DestopModules/MyModul/javascript/scriptaculues.js?load=effects,builder.js")

 

Label1.Text = "<a href='http://myportal/Portals/0/images/image1.jpg' rel='lightbox' title='my caption'>image #1</a>"
 

 

but javascript (lightbox) does not work

 
New Post
3/24/2009 5:11 PM
 

Jens-
I think you'll find that your issue is related to at least some of those script libraries using the "$" symbol as a shortcut for their namespace.  This conflicts with DNN's use of "$" as a shortcut for its code.

Here's one thread (there are several) regarding the issue:
 
  http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/76/threadid/108457/scope/posts/Default.aspx
 
 
-mamlin


esmamlin atxgeek.me
 
New Post
3/24/2009 9:55 PM
 

Could you make sure if the path of your javascript is correct?
try to use a firefox and open your site, then check it on Error Console (Menu > Tools > Error Console) to see if there is a javascript error or not.
 

 
New Post
3/26/2009 6:11 PM
 

suwandy wrote
 

Could you make sure if the path of your javascript is correct?
try to use a firefox and open your site, then check it on Error Console (Menu > Tools > Error Console) to see if there is a javascript error or not.

suwandy-
Just to be clear:  There is a definite issue with using PROTOTYPE under DNN due to overlapping use of "$" as a library reference shortcut.  There *may* be issues with the other JS libraries mentioned due to the same reason.  For libraries using "$" as a shortcut, only the last loaded library will get to use "$" -- calls to the other libraries' functions will fail when referenced with the shortcut symbol "$".

While this does not rule out an additional error due to an incorrect path to the JS libraries, even correct paths to the JS libraries will not make it work due to conflicting use of "$" as a shortcut.
-mamlin


esmamlin atxgeek.me
 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...embedded javascriptembedded javascript


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