Hey,
i was just wondering, am I able to use the "

" command in Drupal? I want to add this simple bit of Java: /*********************************************** * Conveyor belt slideshow script- © Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code ***********************************************/ //Specify the slider's width (in pixels) var sliderwidth="300px" //Specify the slider's height var sliderheight="150px" //Specify the slider's slide speed (larger is faster 1-10) var slidespeed=3 //configure background color: slidebgcolor="#EAEAEA" //Specify the slider's images var leftrightslide=new Array() var finalslide='' leftrightslide[0]='Only local images are allowed.' leftrightslide[1]='Only local images are allowed.' leftrightslide[2]='Only local images are allowed.' leftrightslide[3]='Only local images are allowed.' leftrightslide[4]='Only local images are allowed.' //Specify gap between each image (use HTML): var imagegap=" " //Specify pixels gap between each slideshow rotation (use integer): var slideshowgap=5 ////NO NEED TO EDIT BELOW THIS LINE//////////// var copyspeed=slidespeed leftrightslide=''+leftrightslide.join(imagegap)+'' var iedom=document.all||document.getElementById if (iedom) document.write(''+leftrightslide+'') var actualwidth='' var cross_slide, ns_slide function fillup(){ if (iedom){ cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2 cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3 cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide actualwidth=document.all? cross_slide.offsetWidth : document.getElementById("temp").offsetWidth cross_slide2.style.left=actualwidth+slideshowgap+"px" } else if (document.layers){ ns_slide=document.ns_slidemenu.document.ns_slidemenu2 ns_slide2=document.ns_slidemenu.document.ns_slidemenu3 ns_slide.document.write(leftrightslide) ns_slide.document.close() actualwidth=ns_slide.document.width ns_slide2.left=actualwidth+slideshowgap ns_slide2.document.write(leftrightslide) ns_slide2.document.close() } lefttime=setInterval("slideleft()",30) } window.onload=fillup function slideleft(){ if (iedom){ if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+8)) cross_slide.style.left=parseInt(cross_slide.style.left)-copyspeed+"px" else cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+slideshowgap+"px" if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+8)) cross_slide2.style.left=parseInt(cross_slide2.style.left)-copyspeed+"px" else cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+slideshowgap+"px" } else if (document.layers){ if (ns_slide.left>(actualwidth*(-1)+8)) ns_slide.left-=copyspeed else ns_slide.left=ns_slide2.left+actualwidth+slideshowgap if (ns_slide2.left>(actualwidth*(-1)+8)) ns_slide2.left-=copyspeed else ns_slide2.left=ns_slide.left+actualwidth+slideshowgap } } if (iedom||document.layers){ with (document){ document.write('
') if (iedom){ write('
') write('
') write('
') write('
') write('
') } else if (document.layers){ write('') write('') write('') write('') } document.write('
') } }

But it wont let me... any ideas?

Comments

Garrett Albright’s picture

What's the "it" that's not letting you do it? How are you trying to add the code?

Nexus5.01’s picture

The "it" I'm assuming is Drupal, I try to post it into a "Story" for the front page as I want a slideshow there, but when I copy and paste it there it just displays the code.....

That's with "Full HTML" option enabled. I know it's not HTML but I know filtered well filters...

Garrett Albright’s picture

And you have the code between <script type="text/javascript"> tags?

Can you go to Administer > Site configuration > Input filters, click the "configure" link on the "Full HTML" row, and make sure there's nothing there that might be stripping out the tags?

Nexus5.01’s picture

http://i279.photobucket.com/albums/kk127/nexusv2/java.jpg

They are my filter settings, everything look as though it should let Javascript run yes?

Do I need a module to run JS?

Garrett Albright’s picture

Yes, it looks right to me… Maybe the code itself is broken? Can you get it to work if you just put it in a standard HTML file, outside of Drupal?

Nexus5.01’s picture

Yep works as it should.

Garrett Albright’s picture

Hmm.

Do you have Firebug installed? That can be helpful in diagnosing JavaScript errors. Enable it and keep an eye on the Console.

Nexus5.01’s picture

Yes it's installed :)

What am I looking for?

This is all that was in the console:

Firebug's log limit has been reached. %S entries not shown. Preferences
ddscripttitle is not defined
[Break on this error] Bookmark

online:
leftrigh...slide.htm (line 126) showincontentheader is not defined [Break on this error] if (showincontentheader) leftrigh...slide.htm (line 150) Use of getBoxObjectFor() is deprecated. Try to use element.getBoundingClientRect() if possible. [Break on this error] undefined Firebug's log limit has been reached. %S entries not shown. Preferences Firebug's log limit has been reached. %S entries not shown. Preferences Drupal.settings.teaser is undefined (?)()()cc3c6434...60fa46.js (line 2211) e()cc3c6434...60fa46.js (line 13) e()cc3c6434...60fa46.js (line 13) teaser()(Document edit)cc3c6434...60fa46.js (line 2207) (?)()()cc3c6434...60fa46.js (line 54) e()cc3c6434...60fa46.js (line 13) attachBehaviors()(Document edit)cc3c6434...60fa46.js (line 53) (?)()()cc3c6434...60fa46.js (line 288) e()cc3c6434...60fa46.js (line 13) e()cc3c6434...60fa46.js (line 13) e()cc3c6434...60fa46.js (line 13) e()cc3c6434...60fa46.js (line 13) [Break on this error] var body = $('#'+ Drupal.settings.teaser[this.id]); cc3c6434...60fa46.js (line 2211) BUT this was there prior to even copy and pasting the script in there... I submitted the story with the JS in it, but it went blank (the console)
Garrett Albright’s picture

That output does not make sense to me…

Sorry, but I'm out of ideas…

Nexus5.01’s picture

okay then no problem, thanks for your help anyway?