Zymic Forums

Webmaster resources

Zymic IRC Server

Chat in real time at irc.zymic.com - Learn More

Welcome

Welcome to the Zymic webmaster forums. Our forums are here to provide people the free ability to discuss a range of websites related topics such as design, development coding and marketing.

In order to post you will need to register for a zymic account or if you already have one simply login by using the form on the left.

left Zymic Webmaster ForumsWeb Design & DevelopmentClient Side ScriptingJavaScript right
  Reply to this topic Start new topic
left right
chrislaughlin
post Aug 3 2011, 08:45 PM
Post #1


Newbie
*

Group: Members
Posts: 1
Joined: 3-August 11
Member No.: 201,722



Im trying to add a twitter trends section to my web site, im trying to do this using the json object that twitter provides from accessing this URL (http://api.twitter.com/1/trends.json) when i use the following code i see the below error. Does anyone know where im going wrong ?

var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "http://api.twitter.com/1/trends.json",true);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) {
if (xmlhttp.status!=404) {
alert(xmlhttp.responseText);
}
}
}
xmlhttp.send(null);

Error :

XMLHttpRequest cannot load http://api.twitter.com/1/trends.json. Origin null is not allowed by Access-Control-Allow-Origin.


This was tested in chrome but worked in IE and idea's ?
Go to the top of the page 
 
  + Quote Post
ssfdre38
post Aug 4 2011, 12:27 AM
Post #2


THE SILENT FORUM NINJA
*******

Group: Administrators
Posts: 3,758
Joined: 23-January 10
From: on your screen
Member No.: 127,507



its due the fact that ALL remote connections are NOT allowed on Zymic
Go to the top of the page 
 
  + Quote Post
ThomasNJ
post Mar 22 2013, 09:10 PM
Post #3


Newbie
*

Group: Members
Posts: 1
Joined: 21-March 13
Member No.: 277,249



QUOTE(ssfdre38 @ Aug 4 2011, 12:27 AM) *
its due the fact that ALL remote connections are NOT allowed on Zymic

what if I only trying to load the local file? Like bellow:
CODE
    if (window.XMLHttpRequest){
        xmlhttp=new XMLHttpRequest();
    }else{
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    
    var xmlPath="http://myzymicID.zxq.net/"+"Assets/"+document.title+".xml";
    xmlhttp.open("GET",xmlPath,false);
// by using "false" at async, the script will not go pass this line. But if I change to "true", it will just hang in xmlhttp.readyState ==0 and page not found
    xmlhttp.send(null);
    xmlDoc = xmlhttp.responseXML;
    var photoX = xmlDoc.getElementsByTagName("photoX");
    
    var photoIcons=new Array();
    var photoTips=new Array();
//..... and so on and so to load my photos


The same script works elsewhere, but just not here, is there anything I need to change in order for my photo album to load out of the xml file?
Go to the top of the page 
 
  + Quote Post
ssfdre38
post Mar 23 2013, 04:37 AM
Post #4


THE SILENT FORUM NINJA
*******

Group: Administrators
Posts: 3,758
Joined: 23-January 10
From: on your screen
Member No.: 127,507



dont add the http://myzymicID.zxq.net/ and then the server wont read it as remote connections and will allow you to use it
Go to the top of the page 
 
  + Quote Post
 Reply to this topic Start new topic
left right
0 Members:
left right
 


Lo-Fi Version Time is now: 20th June 2013 - 02:58 AM