jquery files conflicts how to detect? - javascript

Q:i have a general problem ,when i wanna to do some thing and i find the jquery file which can do exactly what i wanna to do . after a while i need another case and i find that another jquery file serve me and fix my problem .after i add set of jquery files i find conflicts among those files and some features does not work or work in awkward manner ..and when i try to find which file exactly the source for those problems i find myself in closed circle cannot modify this file or cannot delete this file or cannot find that file itself at all.sometimes the file like this:
<script src="http://jqueryjs.googlecode.com/files/jquery-1.3.js" type="text/javascript"></script>
cannot modify it.
the problem has many faces,and i cannot really know how to handle the whole matter from the beginning.
can any one give me instructions ,advices,notes, or explanation to prevent the problem from the beginning and how to fix it if it was happened.

Please have only one instance of Jquery Library.
The library has the capability to solve the issues.
Seperate instances or files will confuse the code.
I hope this helps.

If you point your browser at http://jqueryjs.googlecode.com/files/jquery-1.3.js it will give you the JS file for you to download and save as your own copy. You can then change it as you want and link it in your website rather than use the one located at googlecode.com.

http://api.jquery.com/jQuery.noConflict/
This link suggests few of the ways to avoid the jQuery conflict. Please check that as it could give you some more idea to resolve your problem.
Regards,
Lakxman Kumar C

Related

How to remove these letters at the top of the page

Today I found that my Wordpress website has encountered a problem. There are two unexpected letters at the top of the page which can be found in the screen shot below. I can't find where it is from the raw files of Wordpress. I don't know what happened. Could somebody help me please?
Heya :)You might be using some website screenshot plugin. Deactivate that plugin and then check the output. :)
i've had the same problem a while ago only instead of an n or two n's in your case i had a v just at the same place as yours is. What helped for me where the following steps.
Check all files, header.php, template files, etc.
Deactivate and activate your plug-ins. Maybe even try the Wordpress Re-install function from the updates page. Don't worry none of your contents like pages, posts, etc will be lost.
Check your widgets, sidebars and other content blocks from the back-end but also the corresponding template files.
If you have a decent editor like in my case PHPstorm make use of the show history function. It makes searching a lot easier.
I hope just like i had your problem will be solved after taking these steps.

Proper usage of <script language="javascript" type="text/javascript">

So, Im currently developing a prototype system for a requirement in my degree.
My question is how do you use the code ? it seems like it only caters to one html file that I originally coded it.
To be more specific:
I already called the code to power my real time calendar and clock for this specific schedule.html file
I used the same line to another adddate.html file to produce a confirm box but for some reason the confirmation box is working on the schedule.html file not in the adddate.html file
can anyone help? please go easy on me im still learning its only been 1 and half weeks of coding...
FAQS:
Yes, They are in the same file folder for anchor href purposes (prototype still)
No, I haven't read everything there is to know about javascripting (sorry...)
thanks in advance!
If you are writing the js code inline all you need is
<script>
// code goes here
</script>
Otherwise you need the source (src) attribute if you are pointing to a file
<script src="/file-name.js"></script>
Javascript is the default so you don't need the type or language attributes. Also the src attribute is the relative location so if you need to change directories, ../directory/file-name.js - as an example.
Hope that helps.

Drupal 7, how to push a div below the js files

I need to push a div right above the end of the body tag, but there are allways scripts above it and i need it below of them
I already tried:
I tried to use Hook_page_build to push them but it allways comes above the js files.
I also tried page_alter
I gave it 999... weight to see if something happens but nothing
I also tryed to put it in a drupal_add_js(' .. '), but it is wrapping them with "".
Any ideas ?
Thank You
A solution could be to use the template file https://api.drupal.org/api/drupal/modules!system!html.tpl.php/7 and add the div there.
https://www.drupal.org/node/1089656 - generic documentation about templates
In your case, you might copy html.tpl.php to sites/all/themes/[yourtheme]/templates/ and to the modification there to have the div where you'd like.
If you use a sub-theme of the main theme, copy the html.tpl.php from your main theme, instead of Drupal core.
drebabels has the same question on Drupal Answers https://drupal.stackexchange.com/q/19132/48277
Kiamlaluno's answer explains how to achieve that using hook_page_build() : https://drupal.stackexchange.com/a/19134/48277
However, his answer is working if your theme has a similar structure in html.tpl.php. Use it as an example.

Google Chrome Extension

I have a few questions that need answering. I am trying to create a Google Chrome extension and I need every page to be monitored for a keyboard action. I have added a content script that runs on the page load and when you click the keyboard shortcut an alert is shown.
What I want to do is instead of an alert have something like fancybox, thickbox, etc... however all of those are jquery plugins which adds a dependency to my js file. I tried launching the plugin before my js file but it still does not work.
I run the content script from the manifest.json file with
"content_scripts": [
{
"matches":["http://*/*", "https://*/*"],
"run_at":"document_start",
"js":["jquery.simplemodal.1.4.1.min.js", "shortcuts.js"]
}
],
I cannot execute an HTML page where the js is located I have to use a js file.
so what I want to know is if either there is a way to include the plugin without physically adding it to my file or if there is a way to call the js file which then just executes an HTML file or if there is another way of creating a popup screen like fancybox that is already included in js.
Another question I have is if there was a way to embed HTML into an alert box (this is a backup if I cannot figure out the above question)
and finally does anyone know of an execution command for x-webkit-speech? I want the command to start recording and somehow some people have used some commands (none of which answer my question) so someone somewhere knows a little more about this function then me. I would really appreciate help with this I am really close to finishing my program and these are my last holdups with these questions answered I will be able to release my extension. Please help where you can I have researched and researched everywhere all different ways of trying these things and none have worked.
edit:
You were correct (JHurrah) including the jquery actually solved the problem I really appreciate that. simple yet successful I just assumed the jquery provided was enough but I guess everyone knows what happens when you assume especially when programming.
NewTang I have already looked at that website however I will relook at it and see if I missed anything thanks for the help
yeah see I don't have that I have link edit and flag I looked all over and did not see an add comment button at all... :[
since simplemodal is a plugin it depends on jquery, try including jquery in your manifest before the other scripts.
"js":["jquery-1.5.2.min.js", "jquery.simplemodal.1.4.1.min.js", "shortcuts.js"]
I"m a little confused by your question, but I'll give it my best shot.
1) I think you're trying to ask: Can I use a content_script to inject HTML. The answer is yes, but only through Javascript. So, you could have something like:
//using jquery
$("body").append("Hi, I'm on the bottom of the page");
Your javascript would have to create or load the HTML that would get inserted into the page.
2) No, no HTML in an alert box. You're on the right track with using lightbox, thickbox, etc.
3) There's not many resources on x-webkit-speech, but maybe this can help you get going: http://nooshu.com/experimenting-with-webkit-form-speech-input

Use VIM omnicomplete for javascript with ctags

I am using vim/gvim for 4 months already and now I found a way to use it's strengths.
My tags file is generated very well and here is a simple row in it.
my.namespace.classname /path/to/file.js /^my.namespace.classname = function(first_arg,$/;" f
Here is an example what i need to omnicomplete:
my.namespace.cla <- omnicomplete list with all classnames in the my.namespace
The above is the key to my problem, because it looks like omnicomplete searches only namespace without including "my." in front of it. So i see other element in the omnicomplete list and not my classname at all.
However, if i type :tag my.namespace.classname for example gvim opens the correct file at the correct position.
What is wrong and how can I make it work?
I've noticed that a lot of omnicomplete is not well developed. I've used the php omnicomplete and have had to go in and tweak a lot of it to get it working correctly. I recommend you download omnicomplete for javascript. Then add it to your plugins directory. Then make edits to it until it does what you want it to do.
Sorry I couldn't be of more help - but at least you won't go answerless any longer.

Categories

Resources