i am using add this tool box on my blog. But i want to optimize my blog so i decided to host that add this javascript file from google drive. But when i hosted the file then javascript is not working. But when i try to use javascript file from add this it works. I have tried hosting another javascript file from google drive for other page on my blog and it worked. Tell me how can i fix it, because i copied the entire javascript code from the add this javascript file.
And i put a script source tag as follows.
https://googledrive.com/host/0BxeU3LVwPHLPUldPSUpLOGtzYUk' type='text/javascript'/>
the file in google drive is at this link
https://googledrive.com/host/0BxeU3LVwPHLPUldPSUpLOGtzYUk
The original javascript from addthis is available at the link below
//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-513959962cb3b4b6
currently i am using the original external javascript file from add this, so the like box is showing. And in case you need my site url it is below :
http://techtrickzone.blogspot.in/
How can i get the javascript file from google drive working ??
Thank you for contacting AddThis support.
I am AddThis support agent Elsa. Unfortunately, we do not recommend copying addthis_widget.js into any other location since we update that file fairly often with fixes/updates. If you copy it, you would be stuck on an older version and you wouldn't get updates. If it makes you feel any better, our assets are highly cached, so they really shouldn't add too much load for your users since all the js/css files are probably already available on their browser.
Feel free to contact us for more questions.
Thanks,
Elsa.
Related
Trying to implement a piece of code to display data from a Google Spreadsheet in my GitHub Pages page. I found Sheetrock.js and the JS Fiddle worked, but I'm missing how to setup a basic javascript file structure. I know I can name files ___.js and call them from the html file, but the Sheetrock.js info doesn't use this format. I remember trying this a while ago and after hitting the same roadblocks gave up, so I'm posting to hopefully save others, coming from a similar search for using GSheets in a static site through javascript, hours of searching on such a simple problem.
I searched for hours (through Jekyll tutorials and other JS package installations). I know this seems simple now, but there was only one basic javascript setup I finally found that answered it after searching on 'javascript', 'github pages', and even jquery with GH.
So the basic answer seems to be to simply create an index.js file next to index.html, and this is of course where all the generic javascript goes. The tags and external http CDN js file imports go in the HTML file.
You can use other javascript means such as JSON based access to connect to GSheet data, but Sheetrock.js seems to be doing okay.
There are also ways to adjust the iframe to select columns and use the SQL language base using the Google Google Visualization API Query Language described in this page. The SQL type commands carry over to the Sheetrock.js usage.
Using scripts.google.com, I designed an HTML page wherein user can answer 8 questions and I wrote a piece of code to save that data directly to a Google Sheet.
It's working like a charm and this is the first time I worked on HTML CSS in combination with Google Apps script.
To a step ahead, I tried to create a chrome extension out of it. I honestly know nothing about it. But the fact that my project is running fine, I am not able to understand why I am not able to make a extension out of it.
I read a few articles and did some research. I need help with creating the menifest file as I believe that's one of the reasons why my extension does not work even after loading the html file correctly. Secondly, I noticed that the script which I wrote in Google Apps Script is of .gs file format but all the articles say that it should be a .js file format. If anyone could guide me oon these aspects than I'd be really really happy :)
I'm using Primefaces 5.1. When I load my web page, go into the Firefox debugger and look into the javascript, I see that it has loaded some javascript (Primefaces.js.jsf to be precise) which is part of Primefaces 5.0 version. Now, I have taken care to delete all the references of 5.0. But still I get the same result.
So, my question is- when a web page is loaded, and we see the javascript files loaded, how do we know where a particular script file is being retrieved from?
P.S: I'm not the one who wrote the code to include this js. it is part of the framework. So, I have no control over where it is being accessed from. All I can do is if I know the path of the file, I can modify it to suit my needs.
I have deleted the history/cache/Temporary files and also loaded the page using Ctrl + F5. Didnt help.
Found out why the project was still referring to PF5.0. The primefaces-5.0.jar still co-existed with primefaces-5.1.jar in the WEB-INF/lib directory of the project residing in the glassfish directory 'glassfish3\glassfish\domains\domain1\eclipseApps'.
I need to regularly send html pages to a client as standalone .html files with no external dependencies. The original pages are done with node.js and express and they contains several librairies such as High Charts.
I have done the preparation manually until now, this includes:
Transform all images into blobs
Copy all external .js and .cs inside the page
Minimize where possible (standards librairies such as jQuery or Bootstrap...)
The result is a single .html file that can be opened without an internet connection and looks just like the original.
Is there any tool to do this automatically? If not, maybe I'll code it myself in Python. Do you have any recommendation around that?
Thanks
Monolith is a CLI tool for saving complete web pages as a single HTML file
See https://github.com/Y2Z/monolith
With apologies to OP, as this answer is probably far too late for him, but I'm posting it to help anyone with a similar problem:
HTTrack is an open-source project that does almost exactly what you described, though it doesn't work perfectly on some of the more peculiar JS.
It saves the page with most of the JS, the major images, and everything that the page needs to appear complete. It can be configured to include or exclude the entire or partial JS, images, and CSS.
This does not import all of the JS and other content into the HTML file, but neatly organizes all of the content into one folder and corrects all of the paths to make the folder portable.
It also seems to have trouble grabbing some external sources that are protected, but if it is your local site and simply uses common scripts like JQuery, you should be fine. When I tested it, it correctly downloaded all of my local CSS and any valid external CSS library that I incorporated, the JQuery and derivative scripts that I was using, and the embedded images.
Just to save everyone a question, the program by default saves the downloaded websites to C:\My Web Sites.
I am looking for a simple commandline script/program to automatically "inline" all external css and javascript references for a html file. I basically want to create a single self-contained html file suitable for sending via E-Mail. An additional bonus would be if it could also inline images as data: UIRs, but that part is not so important.
EDIT : I wrote a little Python script for fun. It seems to work pretty well :
Inline2Mail
Or you can still try with :
Front compiler does something like that but it implies javascript. You have an online solution as well, with premailer. Finally you have a Python and a Ruby script to do it.
There is a Node.js library which solves exactly your problem: https://github.com/remy/inliner/ It can be used both as a commandline script and a library.
It will make you a single .html file which can be sent anywhere by any means and be opened later in any browser without the need in Internet connection.
If you think about inlining CSS and Javascript to make a HTML body of an email, just forget about it. Most Email clients out there will either ignore or badly damage your styles and I think all email clients will just plainly drop the inline Javascript in the body of emails.
This Python project of mine can help with getting the CSS styles inline https://github.com/rennat/pynliner
If it's not something that needs to be automated and you're using Windows you could open the web page in Internet Explorer and save it as 'Web Archive, single file (*.mht)'. This will pack everything into a single file, including CSS, JavaScript and images. Note that the recipients needs to have access to Internet Explorer to be able to open the Web Archive. Neither Google Chrome nor Firefox supports mht files, so it's probably a Microsoft only feature.