javascript - Include jsp dinamically depends onChange comboBox -


the requirement following: depends on combobox selected value, have show form or form. each form developed on differents jsp´s pages. now, have jsp´s pages included in main jsp , jquery function, hide or show jsp needed.

<div id="xx" style="display: none;">     <%@ include file="/xxx/xx/xx/jspxxxxxx.jsp"%> </div> <div id="yy" style="display: none;">     <%@ include file="/xxx/xx/xx/jspxxxxxx2.jsp"%> </div>  $jq("#proceso").on('change', function() {         ocultarpantallasprocesos();         var proceso = $jq(this).val();         switch (proceso) {         case 'gc06':             selectexportacion()              $jq('#xx').show()             break;         case 'gc21':             selectexportacion()             $jq('#yy').show()             break; 

this develop not optimize, because main jsps have included html code of rest of jsps.

i want load jsp needed depends on combo box value.

i have tried ajax call , load() jquery method both of load empty page , show me following warning.

$jq('#test').load('/inversiones/inversis/iics/jspexportacionvlfondos.jsp');  $jq.ajax({             async: "false", or             async: "true", (both tested)             type: "post",             url: "/xxx/xx/xx/jspxxxxxx.jsp",             cache: false,             datatype: "html",             success: function(data)              {                  $jq(data).insertbefore("#test");             }          }); 

synchronous xmlhttprequest on main thread deprecated because of detrimental effects end user's experience. more help, check https://xhr.spec.whatwg.org/.

any idea how can develop requirement?? possible inject sentence:

<%@ include file="/xxx/xx/xx/jspxxxxxx.jsp"%> 

directly inside div jquery or javascript?

thansk,

Íñigo


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -