Embedding Google Maps with variable location in XHTML - google-maps

I have a form getting parameters (method=GET, so the parameters are in the query string), and I have an Object with an embedded Google map. I want to make the embedded map dynamic, so that it will reflect the parameters (especially ll parameter for position). There are related questions with answers on how to do it with php and javascript, but is there any way to do it without scripting?
Is it possible in XHTML 1.0 Strict?
Plus, what should be the "target" syntax in the form? Neither "" nor the URL of current page does work, and different page just sends me away, which is not what I want.

When the form and the object(iframe with the map?) are located on the same page you may send the form directly to the iframe, in that case it would be possible to have a dynamic map without any scripting.
But however, when you use POST the parameters are not within the QUERY_STRING.

Related

How to get form data value from html and show on other html page

I am working on a html page with an input bar. How can I get the form data from this page to another html page with a iframe? Because I need to embed the search result from other site but I want to show on my site new page. I just guess should use iframe. But I don't know how to get data and add in page address field.
You have several options here:
1) If your form uses GET method, then all the text data from the form will be passed to next page (which is set up as an "action" attribute of the form) in URL (like www.example.com/?name=John&lastname=Doe). After that, you can extract data from this URL using code from this StackOverflow question and put it inside HTML element using Javascript as well like it is done here
2) Whatever server language you use, you can get query variables from there and put them to the page before sending it to the client. In case of PHP, check this example. NB: don't forget about security.
3) You can temporarily store text in localStorage API of the browser. Simply set the value before submitting the form and then get it on the next page.
iFrame would be inefficient and not needed here.

How can I retrieve and parse just the html returned from an URL?

I want to be able to programmatically (without it displaying in the browser) send an URL such as http://www.amazon.com/s/ref=nb_sb_noss_1?url=search-alias%3Daps&field-keywords=platypi&sprefix=platypi%2Caps&rh=i%3Aaps%2Ck%3Aplatypi" and get back in a string (or some more appropriate data type?) the html results of the page (the interesting part, anyway) so that I could parse that and reformat selected parts of it as matched text and images (which link to the appropriate page). I want to do this with Razor/Web Pages, if that makes any difference.
IOW, this is sort of a screen-scraping question, but really a "behind-the-screen" scraping.
Is it possible? How? A 100 point post-answer-bonus will be awarded to the (or the most helpful) answer.
Use the WebClient class (or .Net 4.5's better HttpClient class) to download the HTML, then use HTML AgilityPack to parse it

dynamic HTML page to pdf

I know there is a list of similar questions but all handle pages without user interaction (static even though some js may be there).
Let's say we've a page the user can interact (e.g. svg than changes, or html tables with drilldown - content changes). Those interactions will change the page. Same happens in stackoverflow when entering the question...
The idea is adding a button, "convert to pdf" taking the state of the html and sending to the user back a pdf version (we've a Java server).
Using the print of the browser is not the answer I'm looking for :-).
Is this a stick in the moon ?
You would have to store the parameters that generate the HTML view (i.e. what the user clicks on, what selections they make, etc). If you can have a list of parameters that generate the HTML view, you can have a method which accepts the list of parameters (JSON post?), generates the HTML view and passes it to your PDF generating routine. I'm not too familiar with Java libraries for this purpose, but PHP has TCPDF can take html output to basically generate a PDF for you. Certainly, there are Java libraries which will allow you to do the same thing, or you can use the parameters to get a list of rows/arrays which can be iterated over and output using the PDF library of your choice.
Both iTextPDF and Aspose.PDF would allow you to do that (I've seen them used in two different projects), but there is no magic and you will have to do some work.
The steps are roughly:
Get (as a string) the part of the document which you want to print with jQuery or innerHTML
Call a service on the server side to convert this to PDF
[Serverside] Use a whitlist - based tool to clean up the hmtl (unless you want to be hacked). JSoup is great for that.
[Serverside] Use IText or Aspose API to create the PDF from the HTML (this is not trivial, you will have to read the doc)
Download the document
I'd also recommend DocRaptor, an HTML to PDF API built by my company, Expected Behavior.
DocRaptor uses Prince XML to generate PDFs, and thus produces higher quality results than similar products.
Adding PDF generation to your own web application using our service is as simple as making an HTTP POST request to our server.
Here's a link to DocRaptor's home page:
DocRaptor
And a link to our API documentation:
DocRaptor API documentation

POSTDATA without buttons in HTML4?

I have graphs in an html page. The graphs are generated by a call to a cgi-bin program in an IMG tag:
<IMG src="http://myserver.com/cgi-bin/StatBarChart.cgi?data=1,2,&data=3,5,1&legend=EC,ER">
Currently, the data for the graphs is passed as GET args (in the URL itself.)
Everything’s working OK, but te GET arguments are too long. I want to pass the data via POSTDATA. All the books I have (and discussions on the web that I’ve found) talk about using POSTDATA in forms that include a Submit button. I just want the graphs to appear as part of the page, without a Submit. Can this be done? Can it be done in HTML4, or does it require javascript?
I would require javascript, as you would have to get the resource yourself and set it to the img tag. This is not possible in html4.
Also, I don't see the problem with a long url. Your user will never see it (unless he looks in the sourcecode, which I don't consider as simple "user" anymore) so there is no problem with that either.

WPF, Frame Control, HTML DOM Document access

Ive used WindowsHost to host a WebBrowser control, and that has allowed me to access the WebBrowsers Document/DOM directly, t read HTML content via mouse clicks on HTML document elements and also to invokes on submit forms. I never found a way even in Net 3.5 to do this when I was searching at the time. Ive found this post http://rhizohm.net/irhetoric/blog/72/default.aspx and it looks like through som magic casing you can expose the dom. BUT My question is, has any one done this, and is it possible once you get the dom to do Invokes to submit contect to html forms and also get HTML elements via mouse click events????
Anyone tried? and was able to do both?
Thanks
I'm using WPF.
add a reference to:
Microsoft.mshtml
then:
var doc = ( mshtml.HTMLDocument )_wbOne.Document;
and this gives you the raw string:
doc.documentElement.innerHTML
in return, if you know how to get information out of the HTML document, i'd appreciate it.
for example get all the s and and the metas and whatever else might be gettable so i can get the information from them? i don't want to dink around with the html, just get the info from them...:-)