JuiceBox Posted November 18, 2010 Share Posted November 18, 2010 Hello, is it possible to retrieve data from remote form, from another domain that I can't control. I want to type in number in my local form text field and then post it to remote form and retrieve data. I know how to retrieve data from local mysql, but don't know how to retrieve it from remote form. Remote form: http://www.otto.de/is-bin/INTERSHOP.enfinity/WFS/Otto-OttoDe-Site/de_DE/-/EUR/PV_DirectOrder-Start?ls=0#lmPromo=la,3,hk,home,fl,Sidebar_Bestellen Working number: 31477682 I want to type in 31477682 on my local text field and retrieve data(price, color, status like "lieferbar") from another domain. Quote Link to comment Share on other sites More sharing options...
Adam Posted November 18, 2010 Share Posted November 18, 2010 The example you provided uses AJAX to request the content, which unfortunately you can't cross-domain (right now at least). There are a number of alternatives you could look into though. Quote Link to comment Share on other sites More sharing options...
JuiceBox Posted November 19, 2010 Author Share Posted November 19, 2010 I found those alternatives, but no one seems to be working for me. I don't have so much experience with AJAX. I set up my local form here: http://www.tsa.lt/betatest/ , but still no results. What I found so far is that it is using this script in directform.js : getArtInfoByAjax : function (artNo, amount, size, artInfoId, performAvailabiltyCheck){ $('#divArtLoading'+ artInfoId).removeClass(directOrder.CLASS_HIDDEN); $('#divAlternativeArticleLayer'+ artInfoId).addClass(directOrder.CLASS_HIDDEN); $('#divSpWheel'+ artInfoId).show(); $.ajax({ url: "http://" + window.location.host + "/is-bin/INTERSHOP.enfinity/WFS/Otto-OttoDe-Site/de_DE/-/EUR/PV_DirectOrder-GetArticleInformation", async: true, data: { artInfoId : artInfoId, artInfoRunningNumber : $('#divArtRunningNo'+ artInfoId).html(), amount : amount, articleNumber : artNo, size : size }, success: function(response){ var artInfo = $('#divArtInfo' + artInfoId); artInfo.find('#divArtLoading'+ artInfoId).addClass(directOrder.CLASS_HIDDEN); artInfo.html(response); if (performAvailabiltyCheck){ directOrder.selectFirstAvailableArticle(artInfoId, artInfo); } else{ // no availability check neccessary, because it is already done in context // of the AKI-Layer. // So, we only determine the desired size and display it. var selectBox = $("#sbTxtSize" + artInfoId); selectBox.selectedIndex = directOrder.getIndexOfSelectBoxValue("sbTxtSize" + artInfoId, size); if(selectBox.selectedIndex != directOrder.SELECT_BOX_VALUE_NOT_FOUND){ selectBox.val(size); var jsonHiddenArtInfo = window.document['hiddenArtInfo'+ artInfoId]; directOrder.changeVariationInfo(selectBox, jsonHiddenArtInfo, artInfoId) } else{ // we did not find the value in the selectbox, so select // the first available variation. directOrder.selectFirstAvailableArticle(artInfoId, artInfo); } } // article exists if (window.document['hiddenArtInfo'+ artInfoId].data != null){ artInfo.find('#txtAmount'+ artInfoId).select().focus(); directOrder.checkAlternativesExistForNonAvailableArticles(artInfo, artInfoId); } // article does not exist else{ artInfo.find('#txtArtNo'+ artInfoId).select(); } artInfo.find('#divArtInfoLoeschen' + artInfoId).removeClass(directOrder.CLASS_HIDDEN); directOrder.processEvent('event', artInfoId, directOrder.SRC_NONE, directOrder.FLG_NONE); }, error: function () { directOrder.resetHiddenArtInfo(artInfoId); var artInfo = $('#divArtInfo' + artInfoId); artInfo.find('#divArtLoading'+ artInfoId).addClass(directOrder.CLASS_HIDDEN); //artInfo.empty(); directOrder.resetArtInfo(artInfoId,artInfo); var artInfoConfig = directOrder.createArtInfoConfiguration(); artInfoConfig.showMsgFrame = true; artInfoConfig.clsMsgFrame = 'frame_err'; artInfoConfig.clsMsgAnyProblem = 'txt_err'; artInfoConfig.msgAnyProblem = window.document['hiddenDOMessages'].dbsTechnicalError; directOrder.refineArtInfo(artInfoId, artInfo, artInfoConfig, true); } }); Tried this method: http://www.johnhamelink.com/2010/07/combat-crossdomain-post-problems-ajax/ but still no luck. Quote Link to comment Share on other sites More sharing options...
JuiceBox Posted November 19, 2010 Author Share Posted November 19, 2010 Ok, I finally solved it Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.