Changeset 8613 for trunk/src/io
- Timestamp:
- 05/14/07 16:12:19 (20 months ago)
- Location:
- trunk/src/io
- Files:
-
- 2 modified
-
xip_client.html (modified) (4 diffs)
-
xip_server.html (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/io/xip_client.html
r7034 r8613 6 6 <title></title> 7 7 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta> 8 <script type="text/javascript"> 8 <!-- Security protection: uncomment the script tag to enable. --> 9 <!-- script type="text/javascript" --> 9 10 // <!-- 10 11 /* … … 223 224 //Remove the query param for the IE7 recursive case. 224 225 xipServerUrl = fixServerUrl(config.server).replace(/(\?|\&)dojo\.fr\=1/, ""); 226 227 //Make sure we don't have a javascript: url, just for good measure. 228 if(xipServerUrl.split(":")[0].match(/javascript/i)){ 229 throw "Invalid server URL"; 230 } 231 225 232 xipUseFrameRecursion = config["fr"]; 226 233 … … 235 242 236 243 var clientUrl = window.location.href.split("#")[0]; 237 document.getElementById("iframeHolder").innerHTML = '<iframe src="' 238 + makeServerUrl("init", 'id=' + xipStateId + '&client=' + encodeURIComponent(clientUrl) 239 + '&fr=' + xipUseFrameRecursion) + '" id="' + xipStateId + '_frame"></iframe>'; 240 241 244 var iframeNode = document.getElementsByTagName("iframe")[0]; 245 iframeNode.id = xipStateId + "_frame"; 246 iframeNode.src = makeServerUrl("init", 'id=' + xipStateId + '&client=' 247 + encodeURIComponent(clientUrl) + '&fr=' + xipUseFrameRecursion); 242 248 } 243 249 … … 257 263 internally by dojo.io.XhrIframeProxy.</p> 258 264 259 < span id="iframeHolder"></span>265 <iframe src="javascript:false"></iframe> 260 266 </body> 261 267 </html> -
trunk/src/io/xip_server.html
r7034 r8613 20 20 ALL OF YOUR XHR-ENABLED SERVICES ON YOUR SITE. 21 21 22 In order for this file to work, you should define a function with the following signature: 22 In order for this file to work, you need to uncomment the script element, 23 and you should define a function with the following signature: 23 24 24 25 function isAllowedRequest(request){ … … 46 47 See xip_client.html for more info on the xip fragment identifier protocol. 47 48 --> 48 <script type="text/javascript"> 49 // <!-- 50 djConfig = { 51 parseWidgets: false, 52 baseScriptUri: "./" 53 } 54 // --> 55 </script> 56 <script type="text/javascript"> 49 50 <!-- Security protection: uncomment the script tag to enable. --> 51 <!-- script type="text/javascript" --> 57 52 // <!-- 58 53 //Core XHR handling taken from Dojo IO code. … … 347 342 xipStateId = config.id; 348 343 xipClientUrl = config.client; 344 345 //Make sure we don't have a javascript: url, just for good measure. 346 if(xipClientUrl.split(":")[0].match(/javascript/i)){ 347 throw "Invalid client URL"; 348 } 349 if(!xipStateId.match(/^XhrIframeProxy[0-9]+$/)){ 350 throw "Invalid state ID"; 351 } 352 349 353 xipUseFrameRecursion = config["fr"]; 350 354 … … 353 357 if(xipUseFrameRecursion == "true"){ 354 358 var serverUrl = window.location.href.split("#")[0]; 355 document.getElementById("iframeHolder").innerHTML = '<iframe src="' 356 + makeClientUrl("init", 'id=' + xipStateId + '&server=' + encodeURIComponent(serverUrl) 357 + '&fr=endpoint') + '" name="' + xipStateId + '_clientEndPoint"></iframe>'; 359 document.getElementById("iframeHolder").innerHTML = '<iframe name="' 360 + xipStateId + '_clientEndPoint' 361 + '" src="javascript:false">' 362 + '</iframe>'; 363 var iframeNode = document.getElementsByTagName("iframe")[0]; 364 iframeNode.src = makeClientUrl("init", 'id=' + xipStateId + '&server=' 365 + encodeURIComponent(serverUrl) + '&fr=endpoint'); 358 366 }else{ 359 367 setClientUrl("loaded");