Avatar of sakthikumar
sakthikumar

asked on 

How to display HTML content in APEX 5.0?

I have HTML code which has buttons and lists, and this includes Java Script also.

I want to create an apex page which displays the html content. just like what I would be getting in a browser.

Is this possible?

below is a sample code, I tried using it in the text of the static page. but the button is not displayed.

<!doctype html>
<html>
<head>
<title> My first java script program </title>
<style type="text/css">
#play_button {
  position:absolute;
  top: 50px;
  left: 200px;
}
</style>
</head>
<script type = "text/javascript">
function addnumbers(x,y)
{
  var x = x+y;
  return x;
}
function printnumbers()
{
  var x = addnumbers(12,23);
  document.getElementById('output').innerHTML = x;
}
//document.write(addnumbers(1,2));
</script>
<Form>
  <div id = "play_button" >
    <input  type = "button" value="click" onclick = "printnumbers(); "></input>
  </div>
  <div id="output"></div>
</Form>
</html>
Oracle DatabaseWeb Development SoftwareWeb DevelopmentWeb Applications

Avatar of undefined
Last Comment
Dan McFadden
Avatar of Dan McFadden
Dan McFadden
Flag of United States of America image

There is no BODY element in the HTML you posted.

Try this:

<!doctype html>
<html>
<head>
<title> My first java script program </title>
<style type="text/css">
#play_button {
  position:absolute;
  top: 50px;
  left: 200px;
}
</style>
</head>
<body>
<script type = "text/javascript">
function addnumbers(x,y)
{
  var x = x+y;
  return x;
}
function printnumbers()
{
  var x = addnumbers(12,23);
  document.getElementById('output').innerHTML = x;
}
//document.write(addnumbers(1,2));
</script>
<Form>
  <div id = "play_button" >
    <input  type = "button" value="click" onclick = "printnumbers(); "></input>
  </div>
  <div id="output"></div>
</Form>
</body>
</html>

Open in new window


Dan
Avatar of sakthikumar
sakthikumar

ASKER

Where should I write this code, I tried in the text of static region, and the button was not coming.
ASKER CERTIFIED SOLUTION
Avatar of Dan McFadden
Dan McFadden
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of sakthikumar
sakthikumar

ASKER

Hi,

I have created a websheet application, but Iam not able to figure out where exactly I need to place the html code.
Avatar of Dan McFadden
Dan McFadden
Flag of United States of America image

I would review the article below.

Link:  http://dgielis.blogspot.de/2010/03/apex-40-ea2-websheets.html

Dan
Oracle Database
Oracle Database

Oracle is an object-relational database management system. It supports a large number of languages and application development frameworks. Its primary languages are SQL, PL/SQL and Java, but it also includes support for C and C++. Oracle also has its own enterprise modules and application server software.

81K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo