Thread Rating:
  • 611 Vote(s) - 2.7 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Serving Content2:Launching and Embedding Curl in HTML
06-15-2011, 05:15 PM, (This post was last modified: 06-20-2011, 04:42 PM by kino.)
#1
Serving Content2:Launching and Embedding Curl in HTML
Working with HTML
As you have already seen, the browser can directly load an applet, allowing the applet to take over the entire display area of the browser. A Curl applet can also be launched or embedded in an HTML page that the browser loads. Embedding a Curl applet allows the applet to share the browser's display area with HTML content.


For Web pages that contain both HTML and Curl content, the following scenario occurs:


1.The browser sends a request to the server

2.The browser interprets the information sent from the server in which HTML is rendered and Curl content is recognized by the browser

3.The browser starts the Curl runtime environment to handle the Curl content

Let's examine each of these scenarios.


Launching a Curl applet from an HTML file
From an HTML file, users can launch a Curl applet by selecting a link that targets Curl content using the Anchor tag .


Embedding a Curl applet in an HTML file
A Curl applet can be embedded in an HTML page using HTML's EMBED tag. Because of the way EMBED works, you will need to specify the MIME type for the Curl file explicitly in the HTML page.


Your Curl applet will appear within a rectangular area in the HTML page, similar to the way other embedded content appears.


In HTML, use the EMBED tag to specify information about Curl content


Code:
SRC=embed-applet.curl
TYPE = text/vnd.curl
PLUGINURL = http://www.curl.com/download/rte/
width = 300
height = 300 >

Where:

•SRC: Identifies the Curl applet that will be launched

•TYPE: Identifies the MIME type

•PLUGINURL: Identifies the Curl runtime environment location (if not previously installed on system)


For example:

Select this link to view the running HTML page:


Embedded Applet


The EMBED tag contains the MIME type for the Curl content as well as the URL information about where to direct the user in the case the Curl runtime is not available on the user's browser. The attributes used in the example do not constitute a full list of what is available for the EMBED tag. However, they are sufficient for creating a working embedded applet.


The HTML code is as follows:

Code:
This is an example of embedding Curl content into HTML.


This is a standard HTML page, with a Curl applet embedded into it.



Beginning of the embedded Curl applet

SRC="../samples/ServingContent/launch-1.curl"
TYPE = "text/vnd.curl"
PLUGINURL = "http://www.curl.com/html/products/surge.jsp"
width = "300"
height = "300" >



End of the embedded Curl applet.

If you want your applet to take over the entire browser display area, you can just link to its source file directly, rather than an HTML file that embeds it.



For more information regarding Embedding HTML, please refer to the following section in the Curl Documentation:Curl Developer's Guide > File Systems and Networking > Interacting with the Browser




Other ways to run Curl applets...

•Launching a Curl applet from another Curl applet. Please see Launching a Curl Applet.

•Generating Curl using PHP or similar scripts. Please see Dynamically Generating Curl Content.



Attached Files
.jpg   
embeddedapplet.jpg (Size: 30.84 KB / Downloads: 2,700)


Possibly Related Threads...
Thread Author Replies Views Last Post
  Styling1:Curl Styles kino 0 5,246 06-16-2011, 09:14 AM
Last Post: kino
  Serving Content3:Dynamically Generating Curl Content kino 0 5,191 06-15-2011, 05:19 PM
Last Post: kino
  Serving Content1:Launching a Curl Applet kino 0 5,371 06-15-2011, 05:12 PM
Last Post: kino
Forum Jump:


Users browsing this thread:
3 Guest(s)

MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1017 - Can't find file: 'mybb_threadviews' (errno: 2)
Query:
INSERT INTO mybb_threadviews (tid) VALUES('24')