Home » Fusion Middleware & Colab Suite » WebCenter Suite & Portal » Creating AJAX portlets in Oracle Portal (Portal 10.1.2)
Creating AJAX portlets in Oracle Portal [message #283652] Tue, 27 November 2007 20:36 Go to next message
alui
Messages: 1
Registered: November 2007
Location: CA
Junior Member
I tried to place the following code inside an html portlet:

<html>
<head>
<script language="JavaScript" type="text/javascript">
var req

function loadURL(url)
{
req=null
if (window.XMLHttpRequest) {
req=new XMLHttpRequest()
}
else if (window.ActiveXObject) {
req=new ActiveXObject("Microsoft.XMLHTTP")
}
if (req!=null) {
req.onreadystatechange=state_Change
req.open("GET",url,true)
req.send(null)
}
else {
document.writeln("Cannot get URL status. Your browser does not support XMLHTTP.")
}
}

function state_Change(){
// if req shows "loaded"
if (req.readyState==4) {
// if OK
if (req.status==200) {
document.getElementById('A1').innerHTML="(Available)"
}
else {
document.getElementById('A1').innerHTML="(Connection Failure)"
}
}
}
</script>
</head>

<body onload="loadURL('http://www.yahoo.com')">
<p>
<b><a href="http://www.yahoo.com">Yahoo test</a> <span id="A1"></span></b>
</p>
</body>
</html>


It works fine offline, but once I put the code into an HTML portlet it doesn't work. I am not getting the security warning pop up so it doesn't look like the xmlhttp request object is being created.

Has anyone been able to get anything similar to work? Is there a better way to do this?
Re: Creating AJAX portlets in Oracle Portal [message #323559 is a reply to message #283652] Wed, 28 May 2008 17:58 Go to previous message
patrickhaston
Messages: 11
Registered: November 2007
Junior Member
I've come across something similar, but not using AJAX. Portal sometimes restricts calls to external web sites from within html, so that could be your problem. If you could use a local site rather than Yahoo for your testing that may work.

Good luck,

Patrick.
Previous Topic: How to develop Portlet - Create Page
Next Topic: Understanding URL
Goto Forum:
  


Current Time: Fri Dec 19 00:34:08 CST 2014

Total time taken to generate the page: 0.09688 seconds