473,444 Members | 1,945 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How can I allow people access to my datafeed with javascript

I get this error: Error: uncaught exception: Permission denied to call
method XMLHttpRequest.open

I think I need to sign my script, but not sure if what I want to do
will even work.

So let me explain.

I have a datafeed on my site www.mysite.com
for simplicity it is a php page with only <?PHP echo "Hello"; ?>

I have a .js file on www.mysite.com that reads the php file.
CODE:
-----------------------------------------------------------------
var xmlHttp
netscape.security.PrivilegeManager.enablePrivilege ("UniversalBrowserRead");
xmlHttp=new XMLHttpRequest();
xmlHttp.onreadystatechange = stateChanged;
xmlHttp.open("Get", "http://www.mysite.com/Get_News.php")
xmlHttp.send(null)

function stateChanged()
{

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById("output").innerHTML=xmlHtt p.responseText
}
}

function GetXmlHttpObject(handler)
{
var objXmlHttp=null

if (navigator.userAgent.indexOf("Opera")>=0)
{
alert("This example doesn't work in Opera")
return
}
if (navigator.userAgent.indexOf("MSIE")>=0)
{
var strName="Msxml2.XMLHTTP"
if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
{
strName="Microsoft.XMLHTTP"
}
try
{
objXmlHttp=new ActiveXObject(strName)
objXmlHttp.onreadystatechange=handler
return objXmlHttp
}
catch(e)
{
alert("Error. Scripting for ActiveX might be disabled")
return
}
}
if (navigator.userAgent.indexOf("Mozilla")>=0)
{
objXmlHttp=new XMLHttpRequest()
objXmlHttp.onload=handler
objXmlHttp.onerror=handler
return objXmlHttp
}
}
--------------------------------------------------------------------------
I want other people to be able to just add a <script> to their site
that accesses my .js file and output the data to their site.

here is the sample of of the script:
<script src="http://www.mysite.com/ajax_notify.js"
type="text/javascript"></script>
<div id="output"></DIV>

Is this possible? To allow the public to access a js file on my server
to read my data and display on their site?

If I do need to sign the javescript, how do I do that?

Jun 16 '06 #1
1 1476

An example of what I want to do is similar to google adwords:

<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

Jun 16 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: TJS | last post by:
if there is a datafeed file created on a server, is there a way with ASP, and no component, to FTP the file to Froogle without first downloading it ? Instead the user could cause the file to be...
2
by: Fran Tirimo | last post by:
I am developing a small website using ASP scripts to format data retrieved from an Access database. It will run on a Windows 2003 server supporting FrontPage extensions 2002 hosted by the company...
8
by: lawrence | last post by:
I'm learning Javascript. I downloaded a script for study. Please tell me how the variable "loop" can have scope in the first function when it is altered in the second function? It is not defined...
16
by: Andy_Khosravi | last post by:
I'm in a bit of a pickle. My employer, a health insurance firm, had me design a small database to track benefit issues. The intended users were technical specialists and some managers (about 90...
11
by: matty | last post by:
Hi, I was wondering if there is a known statistic on how many people disable javascript support from their client, and if they do is it intentional or by some default, and when it is intentional...
9
by: JAKDND | last post by:
I'm trying to find out the best architecture would be for a web+access solution. We have a database of individuals' job details. There's a big table with an ID key field, name addess etc, and a...
6
by: rohayre | last post by:
Im a long time java developer and actually have never done anything with java scripting. I'd like to write a short simple script for calculating a date in the future based on today's date and a...
16
by: Ben Sehara | last post by:
Is there any way I can limit the access to my website? I have a site "A" and I want to allow access to it only from site "B" login user. If someone try to access site "A" directory, I want it...
1
by: Radhey Krishna | last post by:
A very interesting problem for a simple requirement and not easily available solution: How would I create a button which will allow the user to specify where the file to be downloaded will be...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.