JQUERY

  • 1
  • Question
  • Updated 8 years ago
  • Answered
When you type up Html and then change the colours etc with CSS I know you need to put the CSS within insert css here . But could someone tell me how you would go about inserting a jquery? Does this also need to be input like CSS?
Photo of Craig

Craig

  • 449 Posts
  • 11 Reply Likes

Posted 9 years ago

  • 1
Photo of Marije

Marije, Official Rep

  • 4636 Posts
  • 237 Reply Likes
Hi Craig,

Do you have a question? It could be that the code you typed has been interpreted in the post. If you would like to reask, please wrap the code in <!-- and --> (for example: <!-- <style type="text/css"> insert css here </style> -->).
Photo of Connor McCarra

Connor McCarra, Champion

  • 944 Posts
  • 47 Reply Likes
I think he's asking what tags to you put around Jquery(it's the same for Javascript):
<!--

<style type="text/javascript">
Your Jquery code goes here!!
</style>

-->
Photo of Kershnee

Kershnee

  • 2087 Posts
  • 152 Reply Likes
Hi Craig - let us know if Connors reply answers your question. Let us know if you have any further questions regarding this.
Photo of Craig

Craig

  • 449 Posts
  • 11 Reply Likes
Thanks connor you interpreted me correct, thanks for that.
Photo of johnywhy

johnywhy

  • 34 Posts
  • 0 Reply Likes
not working for me. can someone tell me why the following does not work?

<!--

<script type="text/javascript" src="root.inyourear.org/script/jquery.js"> </script>

<style type="text/javascript">

$(document).ready(function() {
$("a").click(function() {
alert("Hello world!");
});
});

</style>

<a href=”#”>Click Here</a>

-->
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Hello Johnywhy

I'm sorry to hear that you're frustrated. We would like to help you if we can. Can you please tell us what this script is supposed to do and where did you get this script code from?
Photo of johnywhy

johnywhy

  • 34 Posts
  • 0 Reply Likes
this is a built-in jquery script, so we cannot troubleshoot jquery itself.

so, to simplify my question, can you help me troubleshoot the basic javascript link to a simple external js file?

i put the following in my yola page (without the comment tags):

<!--
<script type="text/javascript" src="root.inyourear.org/script/test.js"> </script>
-->

the external test.js contains the following (without the comment tags):

<!--
<script type="text/javascript">
alert("Hi");
</script>
-->

shouldn't this work in yola?

thanks
Photo of diane

diane

  • 1238 Posts
  • 121 Reply Likes
try putting in the whole url with http://www etc. that may help
Photo of johnywhy

johnywhy

  • 34 Posts
  • 0 Reply Likes
nope, the following does not work:

<!--
<script type="text/javascript" src="http://root.inyourear.org/script/test.js"> </script>
-->
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Hello Johnywhy

I'm sorry to hear that it's still not working. Are you trying to make a pop-up box that says "HI"?

Maybe we can find something similar?
Photo of johnywhy

johnywhy

  • 34 Posts
  • 0 Reply Likes
no, i don't care about the popup.

my goal is to get any external .js file to work.
Photo of diane

diane

  • 1238 Posts
  • 121 Reply Likes
It looks like this is from Blogger? It's possible that hotlinking may be disabled. You need to be able to hotlink. Yola Silver is pretty affordable and you can upload a js file. If that's not possible, a file host such as sigmirror.com will allow hotlinking.
Photo of johnywhy

johnywhy

  • 34 Posts
  • 0 Reply Likes
not from blogger. blogger is just a redirect on the top-level domain, inyourear.org.

direct-linking is no problem with the js file, you can test by opening this url in your browser:

http://root.inyourear.org/script/test.js

also, i link to another js file, which loads a 3rd-party widget, in the same directory, for another yola site with no problem:

http://www.sevapartnership.org/health...
Photo of johnywhy

johnywhy

  • 34 Posts
  • 0 Reply Likes
i think i found the problem-- had to remove the SCRIPT tags from the js file.