JavaScript - Proxy Server Configuration
if the proxy is an intermediary between the client and the requested url
could that url be sent to two different clients in response? so in stead of this [client]<-->[proxy]<-->[website] it would be this [client1]<-->[proxy]<-->[website] .................. / ...........[client2] meaning if [client1] requests "google.com" on the proxy server the proxy server will request "google.com" and send it back to [client1] as well as [client2] it would just be url sharing between two people, like a real time delicious.com Similar TutorialsHello, first, I'm new here and I hope you can help me The problem is that I'm making a script and I need to have the information of a website on the script which is in a different document. The code of the website is similar to this: Code: <html> <head> <script type="text/javascript"> var name = prompt("Put here your name"); var surname = prompt("Put here your surname"); </script> </head> <body> </body> </html> But I want to give the value of the name and surname to the vars of another script: Code: var name = "What I have to put here to get the info of the web?"; var surname = "What I have to put here to get the info of the web?"; document.getElementById("name").value = name; document.getElementById("surname").value = surname; document.getElementById("loginbutton").click(); Help please! Hi All, I have an issue. I need to access MapQuest JavaScript API and develop maps. I am able to do that on my personal laptop. I want to develop the same on my work laptop and with in my company environment(network). I have 1. We have a firewall which doesn't allow me to access the Mapquest Javascript API. 2. I was give a proxy server name and port number through which I can access the mapquest javascript api. I need to use this proxy server with in the code that is what the systems team say. I don't know how achieve this using JavaScript. I can't use any other language except Javascript or HTML. Please help me. For example say Proxyserver name = proxy.ge.com Port Number = 8502. Thanks in advance, DK Hey everyone, I am new to this forums, and hope I can count on people here to help me when I need help with codes. Basically i'm building a proxy for personal use. The proxy is to do two things. 1): Go to any website I suggest (that part works already) 2): Change watever needs to be changed so I could use it at school (This is the part I need help with) The code is below, and I would appreciate anyone who could help me fix this: Code: <html> <script type = "Text/Javascript"> function Search_Web() { var data = document.getElementById('URL').value; window.location = data; } </script> <center> <h1><font color = green>Enter A Website</font></h1> <input type = "text" id = "URL" value = "" size = "50"> <input type = "Button" value = "Search Web" onClick = "Search_Web();"> </center> </html> hi, my working project (needs a proxy): http://www.mypubspace.com/dashtest/order.html currently working through this tutorial, I have setup a proxy and saved it as proxy.php http://www.wait-till-i.com/2010/01/1...query-and-yql/ I just need to put this piece of code in my JavaScript but not sure where?! Code: var url = $(this).attr('href'); if(url.match('^http')){ url = 'proxy.php?url=' + url; } here is my project code Code: <html> <body> <script language="javascript" type="text/javascript"> <!-- //Browser Support Code function ajaxFunction(){ var townRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari townRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ townRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ townRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } // Create a function that will receive data sent from the server townRequest.onreadystatechange = function(){ if(townRequest.readyState == 4){ var ajaxDisplay = document.getElementById('ajaxDiv'); ajaxDisplay.innerHTML = townRequest.responseText; } } var name = document.getElementById('name').value; var county = document.getElementById('county').value; var town = document.getElementById('town').value; var queryString = "?name=" + name + "&county=" + county + "&town=" + town; //Add the following line townRequest.open("GET", "http://www.mypubspace.com/dashtest/townpubs.php" + queryString, true); townRequest.send(null); } function countyFunction(){ var countyRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari countyRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ countyRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ countyRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } // Create a function that will receive data sent from the server countyRequest.onreadystatechange = function(){ if(countyRequest.readyState == 4){ var ajaxDisplay = document.getElementById('ajaxDiv'); ajaxDisplay.innerHTML = countyRequest.responseText; } } var name = document.getElementById('name').value; var county = document.getElementById('county').value; var town = document.getElementById('town').value; var queryString = "?name=" + name + "&county=" + county + "&town=" + town; //Add the following line countyRequest.open("GET", "http://www.mypubspace.com/dashtest/countypubs.php" + queryString, true); countyRequest.send(null); } function townlistFunction(){ var ajaxRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } // Create a function that will receive data sent from the server ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ var ajaxDisplay = document.getElementById('ajaxTownlist'); var county = document.getElementById('county').value; var town = document.getElementById('town').value; ajaxDisplay.innerHTML = ajaxRequest.responseText; } } ajaxRequest.open("GET", "http://www.mypubspace.com/dashtest/town-select.php", true); ajaxRequest.send(null); } function countylistFunction(){ var ajaxRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } // Create a function that will receive data sent from the server ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ var ajaxDisplay = document.getElementById('ajaxCountylist'); ajaxDisplay.innerHTML = ajaxRequest.responseText; } } ajaxRequest.open("GET", "http://www.mypubspace.com/dashtest/county-select.php", true); ajaxRequest.send(null); } function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } //--> </script> <a href="#" onClick="townlistFunction();">show towns list</a> <a href="#" onClick="countylistFunction();">show counties list</a> <form name='myForm'> <div id="ajaxTownlist"></div> <div id="ajaxCountylist"></div> <input type='hidden' id='name' /> <input type='hidden' id='county' /> <input type='hidden' id='town' /> </form> <div id='ajaxDiv'></div> </body> </html> please help?! I have the following JavaScript (see below). The script requests an XML file from the server and displays it on the page. The script works fine when the requested XML file is stored on the same server as the script. The problem is when I try requesting an XML file from an external server such as the National Weather Service. I get an error. If I take the XML file from the National Weather Service and save it to my server it works. Why can't I use my script to request XML files stored on external servers? Thanks in advance for any help. Javascript Code Code: window.onload = initAll; var xhr = false; function initAll() { document.getElementById("makeTextRequest").onclick = getNewFile; document.getElementById("makeXMLRequest").onclick = getNewFile; } function getNewFile() { makeRequest(this.href); return false; } function makeRequest(url) { if (window.XMLHttpRequest) { xhr = new XMLHttpRequest(); } else { if (window.ActiveXObject) { try { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { } } } if (xhr) { xhr.onreadystatechange = showContents; xhr.open("GET", url, true); xhr.send(null); } else { document.getElementById("updateArea").innerHTML = "Sorry, but I couldn't create an XMLHttpRequest"; } } function showContents() { if (xhr.readyState == 4) { if (xhr.status == 200) { if (xhr.responseXML && xhr.responseXML.contentType=="text/xml") { var outMsg = xhr.responseXML.getElementsByTagName("choices")[0].textContent; } else { var outMsg = xhr.responseText; } } else { var outMsg = "There was a problem with the request " + xhr.status; } document.getElementById("updateArea").innerHTML = outMsg; } } HTML Code Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>My First Ajax Script</title> <script type="text/javascript" src="script01.js"></script> </head> <body> <p><a id="makeXMLRequest" href="http://www.weather.gov/xml/current_obs/KOJC.xml">Request an XML file</a></p> <div id="updateArea"> </div> </body> </html> Hello, I'm using "Cut & Paste Multiple Dynamic Combo Boxes" script. I want to configure it, so at first only 1st combo box is visible and the rest are hidden and only populate based on the selections. Also, when the last parameter (from the 5th combo box) was selected, I need to show the table with the search results based on the all selected parameters. Here is what I have so far: Code: <script language="JavaScript" type="text/javascript"> <!-- /* *** Multiple dynamic combo boxes *** by Mirko Elviro, 9 Mar 2005 *** Script featured and available on JavaScript Kit (http://www.javascriptkit.com) *** ***Please do not remove this comment */ // This script supports an unlimited number of linked combo boxed // Their id must be "combo_0", "combo_1", "combo_2" etc. // Here you have to put the data that will fill the combo boxes // ie. data_2_1 will be the first option in the second combo box // when the first combo box has the second option selected // first combo box data_1 = new Option("1", "$"); // second combo box data_1_1 = new Option("11", "-"); data_1_2 = new Option("12", "-"); data_1_3 = new Option("13", "-"); // third combo box data_1_1_1 = new Option("111", "*"); data_1_2_1 = new Option("121", "*"); data_1_3_1 = new Option("131", "*"); // fourth combo box data_1_1_1_1 = new Option("1111","%") data_1_1_1_2 = new Option("1112","%") data_1_2_1_1 = new Option("1211","%") data_1_3_1_1 = new Option("1311","%") data_1_3_1_2 = new Option("1312","%") data_1_3_1_3 = new Option("1313","%") // fifth combo box data_1_1_1_1_1 = new Option("11111","%") data_1_1_1_1_2 = new Option("11112","%") data_1_1_1_2_1 = new Option("11121","%") data_1_1_1_2_2 = new Option("11122","%") data_1_1_1_2_3 = new Option("11123","%") data_1_1_1_2_4 = new Option("11124","%") data_1_2_1_1_1 = new Option("12111","%") data_1_3_1_1_1 = new Option("13111","%") data_1_3_1_2_1 = new Option("13121","%") data_1_3_1_2_2 = new Option("13122","%") data_1_3_1_2_3 = new Option("13123","%") data_1_3_1_2_4 = new Option("13124","%") data_1_3_1_2_5 = new Option("13125","%") data_1_3_1_3_1 = new Option("13131","%") data_1_3_1_3_2 = new Option("13132","%") // other parameters displaywhenempty="" valuewhenempty=-1 displaywhennotempty="-select-" valuewhennotempty=0 function change(currentbox) { numb = currentbox.id.split("_"); currentbox = numb[1]; i=parseInt(currentbox)+1 // I empty all combo boxes following the current one while ((eval("typeof(document.getElementById(\"combo_"+i+"\"))!='undefined'")) && (document.getElementById("combo_"+i)!=null)) { son = document.getElementById("combo_"+i); // I empty all options except the first one (it isn't allowed) for (m=son.options.length-1;m>0;m--) son.options[m]=null; // I reset the first option son.options[0]=new Option(displaywhenempty,valuewhenempty) i=i+1 } // now I create the string with the "base" name ("stringa"), ie. "data_1_0" // to which I'll add _0,_1,_2,_3 etc to obtain the name of the combo box to fill stringa='data' i=0 while ((eval("typeof(document.getElementById(\"combo_"+i+"\"))!='undefined'")) && (document.getElementById("combo_"+i)!=null)) { eval("stringa=stringa+'_'+document.getElementById(\"combo_"+i+"\").selectedIndex") if (i==currentbox) break; i=i+1 } // filling the "son" combo (if exists) following=parseInt(currentbox)+1 if ((eval("typeof(document.getElementById(\"combo_"+following+"\"))!='undefined'")) && (document.getElementById("combo_"+following)!=null)) { son = document.getElementById("combo_"+following); stringa=stringa+"_" i=0 while ((eval("typeof("+stringa+i+")!='undefined'")) || (i==0)) { // if there are no options, I empty the first option of the "son" combo // otherwise I put "-select-" in it if ((i==0) && eval("typeof("+stringa+"0)=='undefined'")) if (eval("typeof("+stringa+"1)=='undefined'")) eval("son.options[0]=new Option(displaywhenempty,valuewhenempty)") else eval("son.options[0]=new Option(displaywhennotempty,valuewhennotempty)") else eval("son.options["+i+"]=new Option("+stringa+i+".text,"+stringa+i+".value)") i=i+1 } //son.focus() i=1 combostatus='' cstatus=stringa.split("_") while (cstatus[i]!=null) { combostatus=combostatus+cstatus[i] i=i+1 } return combostatus; } } //--> </script> <form> <table style="width: 49%"> <tr> <td style="width: 200px">Option 1:</td> <td style="width: 213px"> <select name="combo0" id="combo_0" onChange="change(this);" style="width:200px;"> <option value="none">-select-</option> <option value="1">1</option> </select></td> </tr> <tr> <td style="width: 200px">Option 2:</td> <td style="width: 213px"> <select name="combo1" id="combo_1" onChange="change(this)" style="width:200px;"> <option value=""> </option> </select></td> </tr> <tr> <td style="width: 200px">Option 3:</td> <td style="width: 213px"> <select name="combo2" id="combo_2" onChange="change(this);" style="width:200px;"> <option value=""> </option> </select></td> </tr> <tr> <td style="width: 200px">Option 4:</td> <td style="width: 213px"> <select name="combo3" id="combo_3" onChange="change(this);" style="width:200px;"> <option value=""> </option> </select></td> </tr> <tr> <td style="width: 200px">Option 5:</td> <td style="width: 213px"> <select name="combo4" id="combo_4" onChange="change(this);" style="width:200px;"> <option value=""> </option> </select></td> </tr> </table></form> This script is used in my html page and I don't have a database to choose from. So, I wonder if it's possible to make all these modifications with only html and JavaScript. Any help will be appreciated. Thanks in advance. I need help to make a Server to server connection I already have a server connected to clients, clients send msgs and it echoes back to all of them and now i want when a client sends a msg it echoes on his server and the other server too .. so when any of the clients on any of the servers sends a msg it is broadcasted all over the servers to all clients This is my SERVER code Code: import java.io.*; import java.net.*; public class MultiThreadChatServer { // Declaration section: This part to declare the server socket, client // socket, input stream // and output stream static Socket clientSocket = null; static ServerSocket serverSocket = null; // server can hold up to 10 clients static clientThread t[] = new clientThread[10]; public static void main(String args[]) { int port_number = 6000; if (args.length < 1) { System.out.println("Server Started \n" + "Now using port number=" + port_number); } else { port_number = Integer.valueOf(args[0]).intValue(); } // Initialization section: Where I try to open a server socket on the // given port try { serverSocket = new ServerSocket(port_number); } catch (IOException e) { System.out.println(e); } // Create a socket object from the ServerSocket to listen and accept // connections // Open input and output streams for this socket will be created in // client's thread since every client is served by the server in // an individual thread while (true) { try { clientSocket = serverSocket.accept(); for (int i = 0; i <= 9; i++) { if (t[i] == null) { (t[i] = new clientThread(clientSocket, t)).start(); break; } } } catch (IOException e) { System.out.println(e); } } } } // This client thread opens the input and the output streams for a particular // client, // ask the client's name, informs all the clients currently connected to the // server about the fact that a new client has joined the chat room, // and as long as it receive data, echos that data back to all other clients. // When the client leaves the chat room this thread informs also all the // clients about that and terminates. class clientThread extends Thread { DataInputStream is = null; PrintStream os = null; Socket clientSocket = null; clientThread t[]; public clientThread(Socket clientSocket, clientThread[] t) { this.clientSocket = clientSocket; this.t = t; } public void run() { String line; String name; try { is = new DataInputStream(clientSocket.getInputStream()); os = new PrintStream(clientSocket.getOutputStream()); os.println("Enter your name."); name = is.readLine(); os.println("Hello " + name + " you can now start chatting with all the connected chat-mates"); for (int i = 0; i <= 9; i++) if (t[i] != null && t[i] != this) t[i].os.println(".." + name + " has entered the chat room .."); while (true) { line = is.readLine(); if (line.startsWith("/quit")) break; for (int i = 0; i <= 9; i++) if (t[i] != null) t[i].os.println("<" + name + "> " + line); } for (int i = 0; i <= 9; i++) if (t[i] != null && t[i] != this) t[i].os.println("" + name + " has left the chat room .."); os.println("Bye " + name + " .."); // Clean up: // Set to null the current thread variable such that other client // could // be accepted by the server for (int i = 0; i <= 9; i++) if (t[i] == this) t[i] = null; // close the output stream // close the input stream // close the socket is.close(); os.close(); clientSocket.close(); } catch (IOException e) { } ; } } At the moment I have an exchange server which enables shared calendars. I would like to use Javascript to write to a shared calendar i.e. add a event. Can this be done? Hi Chaps, I have JavaScript code, that exports a HTML table to MS Excel. This works fine on my development (local) server, however, it fails to work on my 'live' IIS server. Once I click on the Export link, I confirm the "Export to Microsoft Excel?" message, then nothing happens. I am not sure if MS Excel needs to be installed on the server or not? If anyone has any ideas, I'd be most grateful: Code: <script language="javascript" type="text/javascript"> function ExportToExcel() { input_box=confirm("Export to Microsoft Excel?"); if (input_box==true) { var xlApp = new ActiveXObject("Excel.Application"); // Silent-mode: xlApp.Visible = true; xlApp.DisplayAlerts = false; var xlBook = xlApp.Workbooks.Add(); xlBook.worksheets("Sheet1").activate; var XlSheet = xlBook.activeSheet; XlSheet.Name="Report"; // Store the sheet header names in an array var rows = tblrepeat.getElementsByTagName("tr"); var columns = tblrepeat.getElementsByTagName("th"); var data = tblrepeat.getElementsByTagName("td"); // Set Excel Column Headers and formatting from array for(i=0;i<columns.length;i++){ XlSheet.cells(2).value= "Projects - All"; XlSheet.cells(3,i+1).value= columns[i].innerText; //XlSheetHeader[i]; XlSheet.cells(3,i+1).font.color="6"; XlSheet.cells(3,i+1).font.bold="true"; XlSheet.cells(3,i+1).interior.colorindex="37"; XlSheet.Range("A1:B1000").HorizontalAlignment = -4131; } //run over the dynamic result table and pull out the values and insert into corresponding Excel cells var d = 0; for (r=4;r<rows.length+3;r++) { // start at row 2 as we've added in headers - so also add in another row! for (c=1;c<columns.length+1;c++) { XlSheet.cells(r,c).value = data[d].innerText; d = d + 1; } } //autofit the columns XlSheet.columns.autofit; // Make visible: xlApp.visible = true; xlApp.DisplayAlerts = true; CollectGarbage(); //xlApp.Quit(); } } </script> I have a google blogger site on which I want to run a PHP script. The problem is that blogger doesn't have a PHP interpreter. So I was thinking, can I run the php file on a remote server that supports php, and load the result in a div in blogger? Thx! I recently coded a page that extracts certain nodes from an external XML file and prints a line of text on the webpage. It is an HTML page that is strictly devoted to this purpose. There is no other information on it. The page is currently stored locally on my computer, and when I open it, the script runs fine and outputs the correct text. However, when I transferred this script over to my web server, and locate it that way, it doesn't run correctly. When I go to the page, it is supposed to display a line of text at the top. It does when I run the file from my local machine, however when I open it from the server, it doesn't display this text. (Same browser, same computer) When I right-click and view the source, all the code is there, and the files are identical. Any idea as to why the script runs correctly only when I open the HTML page locally? I appreciate any help or advice. Thanks! Ok my lab6 at http://opentech.durhamcollege.ca/~in...rittains/labs/ is conflicting with my interface as it is php... is there a better way for me to do this that will allow it to not conflict? PHP Code: <?php $title = "Lab6"; include "head.php"; ?> <style type="text/css"> table, td, th { border: 1px solid red; } </style> <?php function convert($i) { $CtoF= 9.0/5.0*$i + 32; return $CtoF; } ?> <td> <?php $error = ""; $result = ""; if($_SERVER["REQUEST_METHOD"] == "GET") { $start = ""; $stop = ""; $increment = ""; } else if($_SERVER["REQUEST_METHOD"] == "POST") { $start = trim($_POST["startTemp"]); $stop = trim($_POST["stopTemp"]); $increment = trim($_POST["incrementTemp"]); if(!isset($start) || $start == "") { $error .= "<br/>Please enter number to declare a starting value."; } else if(!is_numeric($start)) { $error .= "<br/>The value entered <b>MUST</b> be a number, you entered: " . $start; $start = ""; } if(!isset($stop) || $stop == "") { $error .= "<br/>Please enter number to declare a ending value."; } else if(!is_numeric($stop)){ $error .= "<br/>The value entered <b>MUST</b> be a number, you entered: " . $stop; $stop = ""; } if(!isset($increment) || $increment == "") { $error .= "<br/>Please enter number to declare a increment value."; } else if(!is_numeric($increment)){ $error .= "<br/>The value entered <u>MUST</u> be a number, you entered: " . $increment; $increment = ""; } if($error == "") { $result .= "<table class='phpTable'>"; $result .= "<tr><th>Celsius</th>"; $result .= "<th>Fahrenheit</th></tr>"; for ($i = $start; $i <= $stop; $i += $increment) { $result .= "<tr><td>" . $i; $result .= "°</td><td>"; $result .= convert($i); $result .= "°</td></tr>"; } $result .= "</table>"; } else { $error .= "<br/>Please Try Again"; } } ?> <script type="text/javascript"> /*var error = "<?php echo $error; ?>"; document.getElementById('error').innerHTML = error; var result = "<?php echo $result; ?>"; document.getElementById('result').innerHTML = result;*/ </script> <h2 id="error"><?php echo $error; ?></h2> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST" > Starting Temperatu <input type="text" name="startTemp" value="<?php echo $start; ?>" size="5"/> <br/> Stop Temperatu <input type="text" name="stopTemp" value="<?php echo $stop; ?>" size="5"/> <br/> Temperature Increment: <input type="text" name="incrementTemp" value="<?php echo $increment; ?>" size="5"/> <br/> <input type="submit" name="submit" value="Submit"/> </form> <h2 id="result"><?php echo $result; ?></h2> <?php include "foot.php"; ?> The assignment was supposed to be done in PHP. But I want to know if there is a better way either way. Like can I use AJAX instead of PHP to do that? or change the way the PHP works... something anything... heya, ^.^ sorry if this is in the wrong section, im new here so i wasn't sure as it concerns both java and php, so basically i've made a website that pings a server address when someone views the site, but currently it will ping every time you f5 or refresh ect, what i need it to do is only ping once every 2mins, store the value for when its not being pinged to be displayed, now i got told this could be done in javascript?, but my knowledge of javascript is very minimal, i also got told that "var m_pingDomain_timer = setInterval(dopingDomain, 120);" may have something to do with it?, and help /code or pointers in the right direction would be a great help , il leave you with the PHP code so you can look over below Code: <tr> <td class="SEBody1"> <?php // Function to check response time error_reporting(0); function pingDomain($domain) { $starttime = microtime(true); $file = fsockopen ($domain, 80, $errno, $errstr, 10); $stoptime = microtime(true); $status = 0; if (!$file) $status = -1; // Site is down else { fclose($file); $status = ($stoptime - $starttime) * 1000; $status = floor($status); } return $status; } echo '<table>'; $domainbase ="google.com"; $status = pingDomain($domainbase); if ($status != -1) echo "<img src='img/shard_status_online.png' width='18' height='18' alt='Online' />Online"; else echo "<img src='img/shard_status_offline.png' width='18' height='18' alt='Offline' />Offline"; echo '</table>'; ?> </td> <td class="SEBody1">로그인</td> <td class="SEBody1">Login</td> <td class="SEBody1"> <?php if ($status !=-1) echo "$status ms"; else echo "0 ms"; ?> </td> </tr> Hi, I am hosting my website in free server (freehostia.com) and i am using joomla1.5 . I want to parse RSS from my other websites. Joomla does it with its modules. But the server do not allow outbound HTTP request, hence i had use rss-to-javascript website to parse RSS feeds. It parses well but there is its advertisement below the feed (which i think is nonsense). The link it provides is in the format of <script src="http://somethin.com/somdfile.php?parse=.."></script> when i put the link in my browser i see following document.write("string of my parsed xml file with advertisement at end"); What i want to do is get the sting of above line and edit it to chop off the end advertisement. if there was any method to load that output sting in any variable, the task would had been completed. If anybody knows how to do it, please help me. Hi, I am trying to access an XML file from a server in my JavaScript code. I have an XML file like this: -<stream version="1.2"> -<room id="simulator" time="128168557915"> -<dimention id=0 x="1.25" y="2.00"> <m mcu="160" sid="75"> </dimention> </room> -<room id="simulator" time="128168557928"> -<dimention id=0 x="1.95" y="1.86"> <m mcu="160" sid="55"> </dimention> </room> </stream> this file is generated by an application and I can access it from a URL ( since I am using the simulator for this application the XML is accessible from http://localhost:8081/feed/demo) This xml file is updated every few seconds and constantly growing. I have a javascript code which I've added the following code to it in order to use the data from XML file: <script type="text/javascript"> if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("GET","http://localhost:8081/feed/demo",false); xmlhttp.send(); xmlDoc=xmlhttp.responseXML; document.write("<table border='1'>"); var x=xmlDoc.getElementsByTagName("room"); for (i=0;i<x.length;i++) { document.write("<tr><td>"); document.write(xmlDoc.getElementsByTagName("dimention")[i].getAttribute("x")); document.write("</td><td>"); } document.write("</table>"); </script> Now here comes my problem: if I have the XML file saved on same drive as html page and I address it like this: xmlhttp.open("GET","floor.xml",false); it works fine, but when I pass the URL it doesn't. is there anything else I should do in case of loading the xml from URL? my second question is that I want to use the text values returned by xmlDoc.getElementsByTagName("dimention")[i].getAttribute("x") in an if statement like this : if (valuereturned = 2.00) { do sth } what is the best way to do that, since the returned value is a text. I need the answer ASAP and I really appreciate your help, thanx :-) So, I need a way to push JavaScript commands from the server over to the user. The way this currently works is by using iframes/php. I have an iframe with it's src set to "loader.html". Then I have a "control panel" with multiple links to php files. Every php file here writes JavaScript code to loader.html, so for example alert.php writes <script>alert("hello");</script> to loader.html and the user is alerted. However, this method is rather rudimentary and I was wondering if there was a more efficient way of doing it. I must make clear that I am not a javascript programmer; I am simply trying to get this script to work on my website. It functions perfectly locally (with all browsers), but after uploading to my website, it shows the controls at the top, but not the content. Below is the code for the FreeMind Flash Browser which can be found he http://freemind.sourceforge.net/wiki.../Flash_browser It requires 2 additional files, flashobject.js and visorFreemind.swf plus the FreeMind file (*.mm) that stores the content. The FreeMind file that has the content displays perfectly on localhost, but not on the website. I have all of these files in the same directory and have double checked everything, but it still doesn't function on my website. I have other flash files and scripts on the same website in other pages that function perfectly. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="description" content="freemind flash browser"/> <meta name="keywords" content="freemind,flash"/> <title>MINDMAPS</title> <script type="text/javascript" src="flashobject.js"></script> <style type="text/css"> /* hide from ie on mac \*/ html { height: 100%; overflow: hidden; } #flashcontent { height: 100%; } /* end hide */ body { height: 100%; margin: 0; padding: 0; background-color: #9999ff; } </style> <script language="javascript"> function giveFocus() { document.visorFreeMind.focus(); } </script></head> <body onLoad="giveFocus();"> <div id="flashcontent" onmouseover="giveFocus();"> Flash plugin or Javascript are turned off. Activate both and reload to view the mindmap </div> <script type="text/javascript"> // <![CDATA[ // for allowing using http://.....?mindmap.mm mode function getMap(map){ var result=map; var loc=document.location+''; if(loc.indexOf(".mm")>0 && loc.indexOf("?")>0){ result=loc.substring(loc.indexOf("?")+1); } return result; } var fo = new FlashObject("visorFreemind.swf", "visorFreeMind", "100%", "100%", 6, "#9999ff"); fo.addParam("quality", "high"); fo.addParam("bgcolor", "#a0a0f0"); fo.addVariable("openUrl", "_blank"); fo.addVariable("startCollapsedToLevel","3"); fo.addVariable("maxNodeWidth","200"); // fo.addVariable("mainNodeShape","elipse"); fo.addVariable("justMap","false"); fo.addVariable("initLoadFile",getMap("blues.mm")); fo.addVariable("defaultToolTipWordWrap",200); fo.addVariable("offsetX","left"); fo.addVariable("offsetY","top"); fo.addVariable("buttonsPos","top"); fo.addVariable("min_alpha_buttons",20); fo.addVariable("max_alpha_buttons",100); fo.addVariable("scaleTooltips","false"); fo.write("flashcontent"); // ]]> </script> </body> </html> Hello again... I have written a custom slideshow script which gets the images from an array... The script will change the src of a img, which is a fullscreen background. Now here's the problem, I've been trying to write a function where can define a folder "gallery\test\", and then get all image files in that folder and repopulate the slideshow array. So, is there a way to scan folders? I've searched around and found some solutions where PHP is used, but i really want to keep this pure js, if possible (?) Thanks, Hello there, I am using Dynamic Drive's dhtml windowfile and when I had a link for it to call the popup window, it makes my site deliver a 500 server error. Here is the line of code I'm adding: Code: echo '<td><a class="link" href="#" onClick="ajaxwin=dhtmlwindow.open('ajaxbox', 'ajax', 'pages/post.php', 'Composing Mode: Post', 'width=650px,height=400px,left=300px,top=100px,resize=0,scrolling=1'); return false">Compose</a></td>'; It is not a php issue, I plaintext the link and it still did the same thing. |