Parsing html table from different domain [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 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.

Related

Copying one HTML table to another page [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 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.

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.

Determine which JS file/line is modifying an element on my page [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 need to determine which JS file/line is modifying an element on my page. I'm trying to find a needle in a haystack here. For example, I'm digging through 35 .js files to find out which file is responsible for a change to some text on a webpage. It seems like too much work for such a simple task.
It could be changing it in many many different ways using jQuery, or just javascript. Method is unknown. But it happens on page load.
Is it possible to see this information in Chrome (Developer Tools)?
In Google Chrome:
Right-click on the element you want to detect changes to.
In the Elements pane of the Developer Tools that shows up, right click on the element again (in this case a <label> element.
Choose Break on… ▶ Attributes Modifications (or Subtree Modifications)
Reload. Voila! You are stopped at the JavaScript code making the modification.
I hope following link would help you
https://developers.google.com/chrome-developer-tools/docs/javascript-debugging#breakpoints-mutation-events
It basically tells you how to track down events that mutated given dom element

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