Mhhh still I would love to understand why this happens, this is the
situation:

update.php has before the head:

<script src="../js/jquery.js" type="text/javascript"></script>
<script src="../js/jquery.validate.js" type="text/javascript"></
script>

The script works as normal, then it has a preview of the banner that
outputs this html in the middle of the page (between the body tags and
inside a div)

<script type="text/javascript" src="http://localhost/banner/js/
jquery.js">
<script type="text/javascript" src="http://localhost/banner/js/
rotator.js">

Then it's normal output (several div a img)

Anyway, both script works perfectly, except together (see the error on
the first message)! If i remove the jquery on the including page (the
one inside the head tag) nothing changes, when I remove the jquery on
the included page (the one in the body tags) everything works!

What is the meaning of this? Why does this happens? How can I avoid
it?

Thanks



On Feb 3, 9:43 am, "david.0pl...@gmail.com" <david.0pl...@gmail.com>
wrote:
> I found the problem, since the banner include needs jquery, in a page
> where jquery is altready included (with script src) I have actually
> two instances of jquery, with only one it works perfectly. Now I just
> need to understand how can I check if jquery is already in a page!
>
> Thanks
>
> On Feb 2, 10:53 pm, James <james.gp....@gmail.com> wrote:
>
> > I can't see the issue either...
> > I suggest just creating a simplified version of a form with Validator
> > and the banner code and see what happens. Maybe the issue lies
> > somewhere else.
> > Otherwise, strip out code one-by-one in your banner code to see where
> > the issue lies if you're sure it's in the banner code.
>
> > On Feb 2, 6:43 am, "david.0pl...@gmail.com" <david.0pl...@gmail.com>
> > wrote:
>
> > > Hello, I'm developing an open source banner server, and I encountered
> > > a strange behaviour.
>
> > > First of all the banner system uses jquery (apart from validation) to
> > > rotate the banners, using this code:
>
> > > var image_count;
> > > var current_image=0;
>
> > > $(document).ready(function(){
> > >  image_count = $("div.img-rotate").hide().size();
> > >  $("div.img-rotate:eq("+current_image+")").show();
> > >  setInterval(feature_rotate,5000); //time in milliseconds
>
> > > });
>
> > > function feature_rotate() {
> > >  old_image = current_image%image_count;
> > >  new_image = ++current_image%image_count;
> > >  $("div.img-rotate:eq(" + new_image + ")").fadeIn("slow", function() {
> > >  $("div.img-rotate:eq(" + old_image + ")").fadeOut("slow");
> > >  });
>
> > > }
>
> > > Now, everything works nice, the problem arise when a include the
> > > banner in one of the admin pages (which has jquery validation) called
> > > simply like this:
>
> > > $(document).ready(function(){
> > >     $("#edit").validate();
> > >  });
>
> > > The error is (firebug): $("#edit").validate is not a function
>
> > > The error stops (and the validation works) if I remove the image
> > > rotation code from above. I don't have enough knowledge to understand
> > > thisconflict, does anybody can help me?
>
> > > Thanks
>
> > > David
>
> > > p.s. validator =http://docs.jquery.com/Plugins/Validation

Reply via email to