Home » Forum
NoNumber!

Joomla!® Websites & Extensions
development  -  support  -  consultancy

I try to respond within 48 hours (excluding weekends).
If I haven't responded by then, feel free to post a reminder or bug me via email.

My last reply was: 4 Hours, 42 Minutes ago.

Welcome, Guest
Please Login or Register.    Lost Password?

Can't get JavaScript to work in Joomla Module - HELP PLEASE!!
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Can't get JavaScript to work in Joomla Module - HELP PLEASE!!
#6337
Can't get JavaScript to work in Joomla Module - HELP PLEASE!! 2 Years, 1 Month ago  
I've spent 4 hours trying to get this to work, and I can't...any help appreciated.

Joomla 1.5.15
Sourcerer editor button v2.3.2

Trying to get this code to work in a MODULE:

<!-- BEGIN VOTESMART WIDGET -->
<script type="text/javascript" src="votesmart.org/js/widgets/search/js/jquer...script><script type="text/javascript" src="votesmart.org/js/widgets/search/js/init....t;/script><div id="pvs_search"><a href="votesmart.org">Project Vote Smart</a> - Search Candidates, Elections and Officials<br /><br />Javascript must be enabled.</div>
<!-- END VOTESMART WIDGET -->

The frustrating this is that the code WORKS when it's in an article, but NOT when it's in a module (and perhaps it's then a Joomla issue, but I can't figure it out).

My steps are:

Extensions Menu...Module Manager
New
Custom HTML (Is the the proper choice here?)
Next

Enter Title: MYMOD
Show Title: Yes
Enabled: Yes
Position: right (I want it in the right sidebar)
Order: 0

Menus: All

In Custom Output box, I click the button for "Insert Code" and replace the sample code. I'm left with:

{source}
<!-- BEGIN VOTESMART WIDGET -->
<script type="text/javascript" src="votesmart.org/js/widgets/search/js/jquer...script><script type="text/javascript" src="votesmart.org/js/widgets/search/js/init....t;/script><div id="pvs_search"><a href="votesmart.org">Project Vote Smart</a> - Search Candidates, Elections and Officials<br /><br />Javascript must be enabled.</div>
<!-- END VOTESMART WIDGET -->
{/source}

Click the "Insert" button

Then click the "Save" button

Refresh my Joomla site and the script doesn't load--I get the error code:

"Project Vote Smart - Search Candidates, Elections and Officials
Javascript must be enabled."

Very, very frustrating especially since following the same steps but using an Article rather than a Module works great.

PLEASE--can someone help me and tell me what's wrong?

Thanks!
bigdog
Posts: 4
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
 
#6339
Can't get JavaScript to work in Joomla Module - HELP PLEASE!! 2 Years, 1 Month ago  
What does the output html source look like?
maybe your editor strips the script tags, see here:
http://www.nonumber.nl/sourcerer/troubleshooting
Peter van Westen
Admin
Posts: 9169
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
Need to contact me directly? Go to my contact page.
If you use any NoNumber! extensions, please post a rating and a review at the Joomla! Extensions Directory.
Are you happy with the support? Please consider buying a License Code to help me to continue development and support.
 
#6346
Can't get JavaScript to work in Joomla Module - HELP PLEASE!! 2 Years, 1 Month ago  
When I view the page source, I see:

<!-- BEGIN VOTESMART WIDGET -->
<script type="text/javascript" src="votesmart.org/js/widgets/search/js/jquer...script><script type="text/javascript" src="votesmart.org/js/widgets/search/js/init....t;/script><div id="pvs_search"><a href="votesmart.org">Project Vote Smart</a> - Search Candidates, Elections and Officials<br /><br />Javascript must be enabled.</div>

<!-- END VOTESMART WIDGET -->

That looks to be the same as what I've coded (see above) but it's not rendering on the page...

So is this (somehow) a Joomla issue?

Here's the page source for the full div (I changed the name to "Try PVS" so I could find the code):

<div class="moduletable">
<h3>Try PVS</h3>

<script language="javascript" type="text/javascript">
<!-- BEGIN VOTESMART WIDGET -->
<script type="text/javascript" src="votesmart.org/js/widgets/search/js/jquer...script><script type="text/javascript" src="votesmart.org/js/widgets/search/js/init....t;/script><div id="pvs_search"><a href="votesmart.org">Project Vote Smart</a> - Search Candidates, Elections and Officials<br /><br />Javascript must be enabled.</div>
<!-- END VOTESMART WIDGET -->
</script>
</div>


What's strange is that the code is the same as for the instance on the page where it's working (the Article)--so it's working once on the page correctly, and the second time it's not (or is that the problem--I can only have the code on a page once???)

Thanks for replying, and I'm hoping you can help.
bigdog
Posts: 4
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
 
#6350
Can't get JavaScript to work in Joomla Module - HELP PLEASE!! 2 Years, 1 Month ago  
Do you have a link to both pages?
Peter van Westen
Admin
Posts: 9169
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
Need to contact me directly? Go to my contact page.
If you use any NoNumber! extensions, please post a rating and a review at the Joomla! Extensions Directory.
Are you happy with the support? Please consider buying a License Code to help me to continue development and support.
 
#6356
Can't get JavaScript to work in Joomla Module - HELP PLEASE!! 2 Years, 1 Month ago  
Both are on the home page...the applet is loading and working as an article, but not as a module (on the right side of the page).

http://www.voteeverytraitorout.com/

Thanks for your help...it's much appreciated!
bigdog
Posts: 4
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
 
#6357
Can't get JavaScript to work in Joomla Module - HELP PLEASE!! 2 Years, 1 Month ago  
Probably the script does not like being placed twice on the page. If you remove the one in the article, does the module work then?
Peter van Westen
Admin
Posts: 9169
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
Need to contact me directly? Go to my contact page.
If you use any NoNumber! extensions, please post a rating and a review at the Joomla! Extensions Directory.
Are you happy with the support? Please consider buying a License Code to help me to continue development and support.
 
#6358
Can't get JavaScript to work in Joomla Module - HELP PLEASE!! 2 Years, 1 Month ago  
Ah, I see... the second one has wrong syntax.
You have placed the script inside other script tags:
<script language="javascript" type="text/javascript">
<!-- BEGIN VOTESMART WIDGET -->
....
<!-- END VOTESMART WIDGET -->
</script>

Should be:
<!-- BEGIN VOTESMART WIDGET -->
....
<!-- END VOTESMART WIDGET -->

Peter van Westen
Admin
Posts: 9169
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
Need to contact me directly? Go to my contact page.
If you use any NoNumber! extensions, please post a rating and a review at the Joomla! Extensions Directory.
Are you happy with the support? Please consider buying a License Code to help me to continue development and support.
 
#6362
Can't get JavaScript to work in Joomla Module - HELP PLEASE!! 2 Years, 1 Month ago  
Well, made the coding changes...and no difference...BUT...took out the first instance and...voila! Success!

So--it could only take one instance of the widget on the page (I had tried that before -- taking one out -- but then the coding goof may have been the issue).

In any event, all is well...thanks!! (Wish I could use it twice on a page, but I guess I can understand that might cause a conflict with parsing results back to the appropriate place on the page).

Thanks again--whew--sometimes you can look at something for hours and a fresh pair of eyes finds it right away. (All the more reason for paired programming I guess!)

bigdog
Posts: 4
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
 
#6367
Can't get JavaScript to work in Joomla Module - HELP PLEASE!! 2 Years, 1 Month ago  
What you could do is iframe them... so make a html page that outputs only the widget and use an iframe to show that.
I know, iframes are not the prettiest of solutions...
Peter van Westen
Admin
Posts: 9169
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
Need to contact me directly? Go to my contact page.
If you use any NoNumber! extensions, please post a rating and a review at the Joomla! Extensions Directory.
Are you happy with the support? Please consider buying a License Code to help me to continue development and support.
 
Go to topPage: 1
Moderators: Peter van Westen
hosting joomla
MaxCDN | Content Delivery Network | Accelerate your site to the max
Open Source Training | Online Joomla! Training and Support