I created a HTML file using the animation package in R. Now I'm trying to upload the resulting HTML file to a wordpress blog but don't really know how to make it work. It seems like I might need to upload some js or css files too but am not sure. Also, it seems like I might need to upload the original data files as the HTML file is 2.5kb and the original CSV file is 2500kb. Any suggestions would be appreciated.
I think I have addressed this issue in ?saveHTML if you are using the latest version of the animation package (the second paragraph in the Note section). Perhaps it is still not clear (I'll improve it in the next version), so let me explain it here:
What you need to upload are: the HTML file, the image folder, js and css. The CSV data is not required, since the animation is independent with the data now.
Related
this probably is a newbie question, please don't be mean :D
I'm trying to add a js file to an html page, but can't load it properly. It seems to be a path related issue.
in the HTML page I'm linking the file with
<script src="../src/utils/mapbox.js"></script>
Then on my js file I simply put a console.log to see if the file is loaded properly, but it isn't :/
I tried everything but nothing changes.
screenshot of the debug console
screenshot of the source tab of the debuggin tool
On the second image, I can't see all of my folders I have on VSCode. It is because those file are server side right? If so, how can I solve the issue? :/
this is the folder structure in VSCode
Thanks in advance.
The value of the src attribute needs to be a URL to the JS file.
If you use a relative URL, it needs to be relative to the URL of the HTML document.
This is not the same as the path between the EJS template used to generate the HTML and a JS file on the local filesystem.
First you need to give the JS file a URL. You haven't shown the source code you've written for your websever, but it seems like a reasonable assumption to say that you have used the Express.js static module to make the contents of the public directory accessible.
The src directory is not inside public so it isn't accessible. It also appears to be a directory containing your server-side source code, so it isn't a suitable place to keep your client-side JS.
Move the client-side JS files into a directory inside the public directory.
(If you are writing isomorphic JS then you could create a new directory, perhaps called shared, and expose it using static too).
Once that is done, you can work out the URL to the JS file.
ok I digged into that issue and so basically, I was confusing between client side and server side. I looked at the mapbox api docs and immediately I clicked on the npm quick guide, but this is just for limited cases, when you need to render a map on the server.
All I needed to follow was the web js api of the mapbox service.
So thanks for the comments, I'll try to noob less and study more! :)
I've searched to the best of my capabilities, haven't found an answer.
I'm trying to save pages like this:
http://www.folkbibeln.it/?book=1joh&chapter=1&verse=1
To separate html pages, and keeping the format. I could take each page, copy, paste in a word processing software and save as html, but it would take hours upon hours. I'm thinking there might be some code I could use to automate it? I just can't figure it out, since it's not acting like a straight up html site.
Python is the language I'm using generally.
As an brute-force approach you could use a Headless Browser to load each page for you and save it to a file.
But as mplungjan already mentioned, all texts are in js-files.
You could save these files to your disk, then take the script that builds the html-page and write a little nodejs script that builds all the html-files for you. (Take the original script as a template.)
But nodejs ain't python
Depending on what you're trying to do with the texts, it ain't hard to convert these js-files into JSON and parse it, or directly into a python datastructure that you can import and process in some script of your choice.
Edit:
On a second Look, I just saw this: http://www.folkbibeln.it/chapters/1joh1.html
There seem to be the files you want as plain html, you just have to download them.
All the text is in JS files. You load the URL you gave us. Click ctrl-s and choose Web page complete. Then you will have ALL the text in the folder 1 Joh 1 – Svenska Folkbibeln_files You cannot save as formatted text unless you render the JS in the js files
I am making a program on codepen, and I figured out how to save a file, however, I was wondering if it was possible to save the files to a specific folder on a computer. Ive had a look around and not too sure if its possible to be done on a browser type set up such as codepen.
Thanks
I have a back-end admin section for a site i am building and I would like to allow the site owner to change the background image of a particular element on the public page.
Is the best/only way to go about this by renaming my style.css file to style.php and then use a php variable to fill in the URL of the background-image style. I could then update that variable from a database.
I know this has been asked before but most answers/articles online are from around 2009. Is this the accepted way to do this? Is there a better way to do this yet using javascript/jQuery or having a server side php script that is able to alter the actual CSS file sitting on the server instead of embedding the php in the style sheet.
To address the question in your title, you can certainly have a server-side script simply read the CSS file using a function like file_get_contents, make the modification, and then write it out again at the same path.
Is this a good idea? That depends on your preferences and your needs.
It is better to edit the css file with php than to serve the file styles.php.
The reason is that a .css file will get cached, while the .php file wouldn't. Since the css file only changes rarely, it is better to cache it. You could configure a rather short cache lifetime for .css files.
In continuation with the below post is there any way to take ahead the build.xml and add all the plugins such as table, save etc and compress it with the same build.xml file. Reason is to have one ant script file to compress all the files into one, not only the tinymce js files but also other project related files.
tinymce build script to compress all js files
I know the compressio is possible by declaring additional tinyMCE_GZ.init but why use two methods of the compression in same project. It would nice to have as described in above post using build.xml.
How does the plugin structure works it is possible to take everything in one file & still intantiate plugin, right now when I take out all the script tag from table plugin (i.e from table.htm) file I get javascript error even though the script tag is available into the parent html file from which table plugin is invoked..
I tried that, but i failed. I won't say it is impossible, but it will be pretty difficult to achieve. What i ended up doing is to use two compessing methods.