Hi guys I have been trying to insert a tooltip but I dont know what I am doing wrong..
I am including all the necessary files
<script src="jquery-1.7.2.js"></script>
<script src="jquery.tipTip.js"></script>
<script src="jquery.tipTip.minified.js"></script>
and using this script in the page too
<script language="javascript">
$(function(){
$(".someClass").tipTip();
});
</script>
and this is how I implement it into html
Curabitur dolor eros
what am I doing wrong?
here is the jsfiddle I think
http://jsfiddle.net/jFqFG/
I believe the issue was related to including jQuery twice; once before the plugin was referenced, then once thereafter, thereby nuking the plugin when jQuery was re-initialized.
Removing the second reference to jQuery evidently resolved the issue, as discovered in the comments attached to the question.
There apparently seems to be some kind of a bug when including both jQuery and tiptip files. There is a link here which discusses the same and provides a patch to overcome the same.
I have not tested it . Those who can , please do and provide the results.
Related
When I use jQuery clix then ajax is not working after when I use jQuery latest version then jQuery clix not work.
<script src="{{asset('build/js/custom.min.js')}}"></script>
<script src="{{asset('js/jquery.dataTables.min.js')}}"></script>
<script src="{{asset('js/jquery-calx-sample-2.2.8.min.js')}}" type="text/javascript"></script>
j query calx actually not work latest jquery.min,js, if you use old less than 2 version that can do work. use this cdn i think solve your problem.
or if you face as like-enter code here jQuery tooltip and popover not load and work
you can try this jquery code:-
$('.hasTooltip').tooltip();
or say more details your actual problem.
I'm having a problem with my contact forms on Magento, it doesn't validate and after clicking on the submit button it does nothing and redirects to the same page. It happens with the main contact form and also the footer form. I haven't changed anything and I'm using the "Indepent" theme. This is the link: http://platzchen.com/camisetas/contacts/index/
Thanks in advance for any help!
Fixes or solution:
Suggestion:
Always read carefully validation library documentation as well as basic implemented example.
Offical validation library used on your site is at link :
https://github.com/atetlaw/Really-Easy-Field-Validation
after testing and implementing below missing stuff code start working as required.
Missing code :
In footer: before body tag
<script type="text/javascript">
new Validation('contactForm'); // OR new Validation(document.forms[0]);
</script>
In head tag:
<script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.3/prototype.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.2/effects.js" type="text/javascript"></script>
By doing above two thing validation working perfectly on email.
Please read above mentioned validation library code and example and
give a try again.
Thanks
Hope it helps
I have a very simple javascript animation that looks like this
$(function() {
$('#slider1').cycle();
$('#slider2').cycle();
});
Im then calling in this script like this into my head:
<script type="text/javascript" src="js/slider.js"></script>
Then the divs that have the id "slider1" and "slider2" are contained in php include files being called into the page like this:
<?php include('assets/col1.php'); ?>
The code in the include file looks like this:
<div id="slider1">
<img src="images/image1.png" />
<img src="images/imgae2.png" />
<img src="images/image3.png" />
<img src="images/image4.png" />
</div>
Which works fine except when you get to IE8 or IE9. The javascript will work about 75% of the time which is why this has me baffled. When you load the page or come back to the page, every once in awhile it just doesn't activate the javascript and all the images render in one long column (essentially what it looks like with no js function)
I suspect its something in the order in which IE9 is loading the PHP and the javascript but I am only a novice in both js and php so some very clear help on how to fix this would be really great. Thanks in advance.
Soooo long story long...
PHP will return interpreted HTML. Every time you include a file, PHP will flush the buffers, which means, certain content is returned to the browser prior to others. While this happens, the page is still in a loading state.
For this reason, you need to make sure you call $(document).ready(function(e){ ... });. This will give you code a chance to finish flushing the buffers and load into the browser, before the javascript is executed..
I had encountered a similar issue while using Dojo, which I solved as follows:
Set the main or the parent div display style as none:
<div id="g_body" style="display:none">
Now once Dojo finishes loading, I change the display style to block using the dojo.ready function:
require(["dojo/ready", "dojo/parser", "dijit/registry"], function(ready, parser, registry){
ready(function(){
if(document.getElementById("g_body")!= null){
document.getElementById("g_body").setAttribute("style","display:block");
}
});
});
The pages then only shows when Dojo elements are completely loaded.
I believe there is something similar in jQuery, but I am not sure. Probably:
$(document).ready(function() {});
Hope this helps.
I installed drupal-6.16.
I applied the patch from the post http://drupal.org/node/222926#comment-930745.
It works correctly in simple cases.
But following code of counter is handled incorrectly and counter is now displayed on the page after drupal.
Drupal modifies the string
"alt='1Gb.ua counter'><\/a>")</script>
to
"alt='1Gb.ua counter' /><\/a>")</a></script>
The full code of counter follows:
<br><br>
Text
<br><br>
<!-- counter.1Gb.ua -->
<script language="javascript" type="text/javascript">
cgb_js="1.0"; cgb_r=""+Math.random()+"&r="+
escape(document.referrer)+"&pg="+
escape(window.location.href);
document.cookie="rqbct=1; path=/"; cgb_r+="&c="+
(document.cookie?"Y":"N");
</script><script language="javascript1.1" type="text/javascript">
cgb_js="1.1";cgb_r+="&j="+
(navigator.javaEnabled()?"Y":"N")</script>
<script language="javascript1.2" type="text/javascript">
cgb_js="1.2"; cgb_r+="&wh="+screen.width+
'x'+screen.height+"&px="+
(((navigator.appName.substring(0,3)=="Mic"))?
screen.colorDepth:screen.pixelDepth)</script>
<script language="javascript1.3" type="text/javascript">
cgb_js="1.3"</script>
<script language="javascript"
type="text/javascript">cgb_r+="&js="+cgb_js;
document.write("<a href='http://www.1Gb.ua?cnt=1416'>"+
"<img src='http://counter.1Gb.ua/cnt.aspx?"+
"u=1416&"+cgb_r+
"&' border=0 width=88 height=31 "+
"alt='1Gb.ua counter'><\/a>")</script>
<noscript><a href='http://www.1Gb.ua?cnt=1416'>
<img src="http://counter.1Gb.ua/cnt.aspx?u=1416"
border=0 width="88" height="31" alt="1Gb.ua counter"></a>
</noscript>
<!-- /counter.1Gb.ua -->
Does anybody have this code working?
How should Drupal be fixed to handle this code in correct way?
Other suggestions are welcome.
EDIT:
Removing comments does not resolve the issue.
The issue you describe only when you use the HTML corrector with HTML comments. A quick solution is to remove the comments or disable the HTML corrector.
It would be great if the HTML corrector could handle HTML comments, but IMO HTML comments don't belong in the content of a node etc. If you plan on making markup so complex and special that it needs comments, it's an indicator that it belongs in your theme and not as content.
In your case, you want to add some javascript. Drupal has a function, drupal_add_js, for this, that not only will add the script, but with settings you can cache and minify it for production environment. This will boost performance and general is the way you want to add js to a Drupal site.
Since you are only trying out Drupal, the quickest solution for you now, is just to remove the HTML comments and you should be fine. But if you want to make something meant for a live site, you should check out drupal_add_js.
The input filters settings can be found at admin/settings/filters when you edit or create a new filter here you can decide which roles can use it and if the HTML corrector should be applied.
It is fixed in drupal 7.x.
Details are here.
Enabling the PHP filter module and setting the input format to PHP solved this issue for me.
I got this issue randomly in Drupal6 for all content, with or without editor enabled Filtered, Full HTML or PHP.
Found that culprit is the magic_quotes_gpc flag in PHP.
Luckily I was able to turn it off easily in php.ini, which solved the problem of all kinds of weird escaping.
I've set document.ready in the middle of a page.
It was working fine on local server, on an online production beta server, but failed on the final server.
Any suggestions?
thx
Code:
$(document).ready(function() {
And yes. JQuery is loading and it's working propely
UPDATE: These days I've found the same issue and for futher reference the script tag that includes the jQuery must be propely closed. If not the $(document).ready() is never called.
Wrong:
<script type='text/javascript' src='js/jquery-1.6.2.min.js'/>
Also wrong:
<script type='text/javascript' src='js/jquery-1.6.2.min.js'>
Right:
<script type='text/javascript' src='js/jquery-1.6.2.min.js'></script>
Nowadays using hmtl5 <!DOCTYPE html>
Get Firebug and check:
is jQuery loading or is it missing. And is it loaded before the document.ready ?
is the script throwing any JavaScript-errors?
The most likely problem is the production server doesn't have a copy of jquery. Switching to having google provide jquery for you is a good practice.