How can I add Drift JavaScript to a readthedocs site? - javascript

This is the site Aviatrix and these are the instructions from Drift.
And this is what the readthedocs help says.
However I've tried these and it won't appear on the site.

You've probably already figured this out but I just went through this same process and I figured out a way to do it. Here's how.
I added the drift install script in a drift.js file and put that under docs/jsfiles/
Then all I had to do was add this to my yml:
extra_javascript: ['jsfiles/drift.js']
And that worked! I think this processes the js script at the end of the page load but I'm sure there's a way to move the script to the head tag of each page as well. Will report on it when I figure it out. For now, I'm going to go with this solution.

Related

js corrupt file only working on some pages

I am making a magento webshop, but i have run into some problems with the theme i am using.
I bought it on themeforest, and i have asked the developer for help, but it takes ages for them to answer and come with a real solution to fix the problems, so now i am seeing if someone here can help me solve the problem.
The webshop: http://new.webhipster.dk/index.php/home-left
When i add items to basket ("Læg i kurv"), it only works on the front page (the link listed above). When i go to another page, it won't add the item to basket. (e.g. http://new.webhipster.dk/index.php/roedvin.html)
So my guess is that there is a corrupt js file, but what i don't understand is, that it is the same code which is generated in header on both pages - but still it doesn't work on any other page but the frontpage.
How do i figure out what js file is corrupt and isn't loaded properly?
I have gone trough each one to see if they load, and it seems like they all load exactly like they do on the frontpage.
I guess you are missing a library required for it or might be css. As error in your console window say that it could not found css property.
Because when I tried accessing url directly from browser it's adding items into cart
For Example you are calling -
setLocation('http://new.webhipster.dk/index.php/checkout/cart/add/uenc/aHR0cDovL25ldy53ZWJoaXBzdGVyLmRrL2luZGV4LnBocC9ob21lLWxlZnQ,/product/2/form_key/1Tfx79G6V33Q7l2Q/')
Now try accessing it from the url something like
http://new.webhipster.dk/index.php/checkout/cart/add/uenc/aHR0cDovL25ldy53ZWJoaXBzdGVyLmRrL2luZGV4LnBocC9ob21lLWxlZnQ,/product/2/form_key/1Tfx79G6V33Q7l2Q/
and this will add item in your cart.
Now you debugging should start from function setLocation(). Try doing file search for setLocation function. and check where it is failing.
Hope this will help you atleast for debugging.

BabylonJS Execute Script from External File

I'm having a (simple) issue, but I have no idea how to fix it. Essentially, every tutorial I have come across for Babylon puts all of the Javascript code inside < script > tags in the main HTML page.
However, I would like to have all of my Javascript code inside a separate file. I have tried every way of loading it as I could think of, though I am a novice at Javascript (I am decent at C++, and I can see the similarities); yet I was unable to make it load. (It works fine when called from the HTML page itself).
Does anyone know what (if anything) I can do in order to be able to load my scripts from external files, and still get everything to work? Thanks in advance!
2 options:
register to the DOMContentLoaded event in your external JS file
reference your JS file with the tag at the end of the HTML page
You can find a sample in one of my tutorials here: http://blogs.msdn.com/b/davrous/archive/2014/11/18/understanding-collisions-amp-physics-by-building-a-cool-webgl-babylon-js-demo-with-oimo-js.aspx
Enjoy and thanks for using Babylon.js! :)
David

JavaScript file(jQuery steps) not loading in Google Chrome

I am using a jQuery plugin the file name is jquery.steps.js.
I include it in index.html unambiguously but Chrome will not load this script. It was somehow in the cache earlier which is why I never noticed this.
Can anyone suggest what the problem might be and how in the world I can get it to load.
Thanks in advance
Im not sure why you are getting that problem but you could solve it adding
'?whateverHere'
at the end of your src attribute of the script, that will enforce the script to be loaded again.

Lightbox works but not when uploaded to the server

I have had a good look at previous questions/answers to this but am a newbie.
Have downloaded Firebug - Do not particularly understand.
http://www.deccardy.com/portfolio-field-house.html
Is the page I am trying to sort out with Lightbox.
Any help will be much appreciated.
Also, if you know of a way of lightbox ordering the images, say #1 - #5 - #2 - #6 as opposed in sequence, this would be great!
Many thanks,
Cody
You have 404 errors on page, that's why script is failing.
404 Not Found:
http://www.deccardy.com/effects.js
http://www.deccardy.com/builder.js
The below mentioned files are not publicly accessible. Upload both the JS Files.
http://www.deccardy.com/effects.js
http://www.deccardy.com/builder.js
Get them from here.
You need to load the lightbox.css too. The lightbox works on script-side(you'll see it when you scroll to the bottom of the page), but without the css-file it's not the desired result.
But however: I would suggest an update to the current Version(which uses jQuery).

jQuery 1.7.1 slider not working except on homepage

I have tried to place the slider on every page on this website: http://atripathi.com
It works on the homepage, but doesn't work on any of the other pages (About, Services, etc.)
I know it's probably an easy fix, but I can't get it at the moment.
Thank you for any help or suggestions!
Looks like the original suggestion above is correct. I'm seeing slider javascript includes at the top of your homepage that aren't on the other pages.
Generally, a good way of troubleshooting is to make copies of both pages, index-c.php and about-c.php perhaps, and start removing everything that isn't pertinent to the trouble you're having (other HTML, css includes, etc.) until you get down to only the slider on the page. Once you've done that, you might notice that the one page is slightly different than the other, making it work. You can copy back and forth until it does.
The other possibility is that there's a relative path problem somewhere, because your one page is inside a folder (though I'm guessing you have a .htaccess redirect to a root folder page)? So if all else fails, move the reduced about-c.php to the root folder and see if that then works. If so, you know it's a path problem.
Hope these suggestions help.
I see that jQuery is being included on all your pages but the cycle plugin is only included on the home page. You should be able to update your template(s) to fix this.

Categories

Resources