Edvards Rubens Posted February 3, 2018 Report Share Posted February 3, 2018 Sveiki, es esmu samērā iesācējs js un būtu labi, ja man palīdzētu ar vienu problēmu, man vajag tā, lai izveidoto query linku izpilda tajā pašā lapā ar to pašu linku nekur nepārmetot, un vai to nevar izveidot ar iframe? $("#create_query").click(function () { var query_str = ""; query_str = "https://" + $("#env").val() + ".epower.amadeus.com/" + $("#portal_code").val(); var parameters = "/#FlightType=" + $("#flight_type").val() + "&From=" + $("#from").val() + "&To=" + $("#to").val() + "&Page=Result" + "&QFrom=" + $("#q_from").val() + "&QTo=" + $("#q_to").val() + "&DepartureDate=" + $("#departure_date").val() + "&DepartureTime=" + $("#departure_time").val() + "&ReturnDate=" + $("#return_date").val() + "&ReturnTime=" + $("#return_time").val() + "&IsCalendarSearch=" + $("#mp_calendar").val() + "&Method=Search"; var my_string = ""; $('#search_form_table input,#search_form_table select').each(function () { if (($(this).attr('name') != "") && ($(this).attr('name') != "undefined") && ($(this).val() != "") && ($(this).attr('name') != "env") && ($(this).attr('name') != "portal_code")) my_string = my_string + $(this).attr('name') + "=" + encodeURIComponent($(this).val()) + "&"; // $(this).attr('type'); // $(this).attr('name'); // $(this).val(); }); var query_string = query_str + "/#" + my_string + "Method=Search"; $("textarea#flight_query").val(query_string); }); $('#create_query').click(function () { window.open($("#flight_query").val(), '_blank'); }); Un ir viena ķible pievienojot lapai bootstrap jQuery šis skripts vairāk nefunkcionē, kur varētu būt problēma? Quote Link to comment Share on other sites More sharing options...
Caaliitis Posted February 6, 2018 Report Share Posted February 6, 2018 Nav nepieciešams iframe http://api.jquery.com/jquery.ajax/ 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.