Problem with adding javascript

Permalink
Hello.
I've just made my own block. It have to use flot plotting tool written in JS (http://code.google.com/p/flot/). I encounter a problem: when I simply include required *.js files to view.php it is impossible to edit this page. It seems that all javascript environment stops working (I can see top meiu, but it is not responding).

Maybe there is a way to include js to a block, but to turn it off when page is in edit mode. Or mybe you have any other solution?

dagaz
 
Remo replied on at Permalink Reply
Remo
are you including jQuery on your own?

It's just a guess but I think you include jQuery twice...
dagaz replied on at Permalink Reply
dagaz
Yeap, that was the case. Thanks!
zeetron replied on at Permalink Reply 1 Attachment
Hi Remo,

I'd like to know if there's a simple straightforward approach to stop Jquery libraries from interfering with Concrete 5's In-Context-Editing in Edit Mode. I followed the forums, modified "header_required," Inserted no duplicate Jquery calls and I still can't get the in-Context-Editing working. What can I do? It's kinda urgent.

Please see the attached file
Regards

Chyke
Fernandos replied on at Permalink Reply
Fernandos
oh zeechyke...that's the totally wrong usage of header_required.

You really should recover your header_required and use a little file like /themes/mytheme/elements/header.php to add items to the header.

Please have a look at header.php in the default theme.

You do that this way:
$html = Loader::helper('html'); 
echo $html->css('/themes/mytheme/css/default.css');
echo $html->javascript('/js/test.min.js');
zeetron replied on at Permalink Reply 1 Attachment
I have restored my 'header_required.php' file

The problem appears to remain the same.

I've attached my header file along with this complaint.

The Jquery conflict I'm experiencing disallows the display of some of the Add-Ons I recently purchased like Nivo Slider, ecommerce's lightbox display and even CU3 ER slideshow. More especially those with lightbox or gallery like displays.

Is there a problem loading CSS stylesheets like this ;
<style type="text/css" media="screen">@import "<?php echo $this->getThemePath()?>/css/style.css";</style>

OR jquery libraries like so;
<script src="<?=$this->getThemePath()?>/scripts/coin-slider.min.js" type="text/javascript"></script>

So far I have used this method and its worked for all my sites until I started using the specified Add-Ons above.

How do I override any of these conflicts.

Regards