Skip to content

Commit

Permalink
add getRemoteXML to get remote url files to avoid cross origin reques…
Browse files Browse the repository at this point in the history
…ts problem
  • Loading branch information
osallou committed Dec 28, 2011
1 parent cc177c2 commit 2adbbdf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
7 changes: 7 additions & 0 deletions getRemoteXML.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php


echo file_get_contents(urldecode($_GET["url"]));


?>
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@

$("#remotexml").button();
$("#remotexml").click(function(e){
xmlUrl = $('#remotexmlurl').val();
xmlUrl = "getRemoteXML.php?url="+encodeURI($('#remotexmlurl').val());
$('#blasttabs').tabs().tabs('select',1);
getXML();

Expand All @@ -123,7 +123,7 @@
$("#blastcanvas").click(function(e){
var position = getPosition(e,document.getElementById("blastcanvas"));
var y = Math.floor(position.Y/10);
window.open("sequence.html?hitnum="+sequences[y]["hitnum"]+"&hspnum="+sequences[y]["hspnum"]+"&file="+xmlUrl);
window.open("sequence.html?hitnum="+sequences[y]["hitnum"]+"&hspnum="+sequences[y]["hspnum"]+"&file="+encodeURI($('#remotexmlurl').val()));
//http://localhost/test/sequence.html?hitnum=1
});

Expand Down
3 changes: 2 additions & 1 deletion sequence.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
xmlUrl = "demo/blast.xml";
}
else {
xmlUrl = $.getURLParam("file");
//xmlUrl = $.getURLParam("file");
xmlUrl = "getRemoteXML.php?url="+$.getURLParam("file");
}
getXML(xmlUrl);

Expand Down

0 comments on commit 2adbbdf

Please sign in to comment.