Copying one HTML table to another page [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
Currently I am working on a small dashboard used for my job, however, I am stuck with one part of it. The main idea (will skip the specific of the dashboard) is the following:
I have a big table of data on one page - regular HTML table, 9 columns, but a huge amount of rows - the number varies. I have to copy that table and insert it into another page and then pass that table as some sort of array to make some calculations with it. Is that possible? Do you any thoughts on how to do this? Is there some sort of text area that would accept the HTML table as it is to pass it to PHP then? Any solutions would be acceptable.

Unless you have access to the server to add javascript to the page it's not possible to do what you want in the way that you are asking.
One way forward is to build a php script to load the page using CURL and then you can process the page however you wish.
you might want to look at PHP Simple HTML DOM Parser this php tool allows you load in an external php file and process it, looking for certain html tags and extract the data.

Related

How can one create a complete block in html using Javascript [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I Couldn't find anything on this so maybe you guys could give me some clues if this is possible using JavaScript or not.
Like the question asks, how can I pop an entire block into my html with just using SJ or maybe JQuery?
No not just a div saying Hello and with pretty colors and stuff but an entire block. Meaning a Div with actual content like forms, buttons, spans, links, images and other stuff.
I wanted a temporary popup that wouldn't save data and make the entire project really heavy but instead just appear with some preset values that's called by a JSON script.
Like a temporary form of some sorts.
Everything you are describing is pretty common use of Javascript so it is strange that you did not find anything about it.
There are entire sites written on pure Javascript.
Nevertheless , for a out-of-the-box solution to your inquiry , there is a really good plugin , check it out here : http://trentrichardson.com/Impromptu/.
If you want to learn how to do it yourself , then you should read on the Javascript DOM manipulation functions like :
Node.removeChild()
Node.replaceChild()
Node.insertBefore()
Node.hasChildNodes()
Start from "https://developer.mozilla.org/en/docs/Web/API/Node/appendChild" and go on.
You mean like this http://www.w3schools.com/jsref/met_document_createelement.asp ?
You can add elements to the body of your web page with javascript.

HTML Generated image link? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm a web designer and i'm currently designing a website that includes images. I was wonder if anyone can tell me what it is called or if you can guide me the right way so i can do some research on my own and learn it.
Basically what i need to know is how can you lets say if the user click on the image it will bring them to another html with that image plus that image information
A current example... wallhaven.cc if you go there and if you click a wall paper.. every wallpaper has a specific link. is that generated or does that mean that literally EVERY image on that website has a web page of its own?
Yes it is possible to do it both ways you can use what is called dynamically generated web pages or you can create each page manually.
So if you were to go with the dynamically generated web pages you would probably want to consider looking around a JavaScript Template Engine. I currently am using this one while I build my own. http://idangero.us/template7/. That is the best JavaScript Template Engine you can get. Plus it is free and Open-Source. But if you go with creating each page manually you will have a lot of work on you hand! So personally I would choose using the JavaScript Template Engine!
Have a great day.
Joseph Shenton
http://timedevs.net/
There is one page for image details, the number at the end of the link is the image id, which tells the server which data to output.

Is there any way keep part of my code in a seperate document? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
This might be a dumb question, but I'm working a theme for my Tumblr blog and the block where all the data regarding rendering posts is fairly large and just tends to be a pain in the ass to have in the middle of everything. I was wondering if there was any way that I could have this block in a different file and insert it in to my code with just a line or two instead of having this 150 line piece of code in the middle of my document that I'm never going to touch.
I have a feeling that the best way to do this would be with JS but I'd prefer pure HTML if possible.
I'm guessing the block of data you want to move to a separate file is also HTML code? If so, you can do this: Move that block of code into a separate .html file and insert this line into your page:
<object type="text/html" data="yourFile.html" style="height:300px; width:96%; margin:2%;"></object>
The height, width, and margin should be like you actually want it. The values in there at the moment is just an example. The important part is the "data" attribute.
If you don't want the external HTML code to display, you can set the visibility of the object to hide it.
Hope this is what you were looking for.

Parsing html table from different domain [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
i'm making an iOS app for showing schedule for my college.
I'm kinda new in javascript, i thought it's simple until now. I know this task may be simple and trivial, but listen:
My application generates link with parameters and then creates a dynamic page with an iframe and opens link within it (src of an iframe sets to generated link), link leads to a page on a different domain, it has a HTML table with needed data in it's cells, each cell has it's own attribute, so i thought i could simply find each needed cell by it using DOM, but accessing iframe's DOM doesn't work. I can change absolutely nothing on server side - even college technicians do not know how it works and of course they'll not touch anything until it breakes.
So the question is: how can i get the text from the cells of that table by knowing their attributes and store it as a variable in javascript?
Almost forgot, example of a page itself:
http://ikis.tsogu.ru/shedule/show_shedule.php?action=group&union=0&sid=96&gr=111&year=2015&vr=0
Basically, you cant. Due to same-origin policy. Check out this and this similar questions.

How to apply information submitted in Code Mirror? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I am looking to build a personal code playground. Basically I am looking to make 3 Code Mirror text areas for HTML, CSS and JS, Basically I am puzzled on how to make a result box. Any help would be appreciated... Thanks :)
Just to clarify I am looking for a way (I am aware of iFrames) to submit code from 3 "CodeMirrors" and then gets applied to a result area below. I am also looking for pointers as to how todo this as I have only been coding 6 months.
Approach 1 - using iframes:
It's the approach used by jsfiddle. Create 3 textareas to put your code (html, javascript, css). When the user press a button, you can send an ajax request to the server, sending the 3 texts, in order to generate a temporary page that is the composition of the various parts and returning its URL. Then create an iframe that points to it (or update the src of an existing one).
It's quite simple.
Approach 2 - client side:
You can append both the html, css and js in the actual page. It's quite simple, but can generate various issues with conflicting styles, ids and javascript functions/variables names (that you must manage manually).

Categories

Resources