PDA

View Full Version : Ajax Tabs content script question



XAKERA
12-24-2007, 08:50 PM
1) Script Title:
AJAX TAB 2
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm
3) Describe problem:
I installed This mod. When I add in the Ajax Tab JAVA SCRIPTS doesn't work the java script. but then i change id=countrycontainer to id=#iframe and This java script works great. In iframe works java script great but in countrycontainer doesn't work what can i do? help me plz

ddadmin
12-24-2007, 10:59 PM
With id=countrycontainer, you're telling the script to use Ajax to fetch the external page. Are you running the script offline or online? What browser?

XAKERA
12-25-2007, 07:37 AM
I have not site in online i am making in Localhost.
I will tell you mine problem. I remake ajax tab 2 to ajaxa navigation. and Than i adding Some other ajax mod it doesn't work in ajax tab. but when i change rel=coutryside to rel=#iframe it works. I think this is problem of ajaxtab.js

XAKERA
12-25-2007, 04:04 PM
please someone help me I need help :(
Thanks

XAKERA
12-26-2007, 10:00 AM
in ajaxtab2 i Add this java script and doesn't work this java

<script language="JavaScript" type="text/javascript">
<!--
function showSelected()
{
var selObj = document.getElementById('selSeaShells');
var txtIndexObj = document.getElementById('txtIndex');
var txtValueObj = document.getElementById('txtValue');
var txtTextObj = document.getElementById('txtText');

var selIndex = selObj.selectedIndex;
txtIndexObj.value = selIndex;
txtValueObj.value = selObj.options[selIndex].value;
txtTextObj.value = selObj.options[selIndex].text;
}
//-->
</script>
<form>
<p>
<select id="selSeaShells">
<option value="val0">sea zero</option>
<option value="val1">sea one</option>
<option value="val2">sea two</option>
<option value="val3">sea three</option>
<option value="val4">sea four</option>
</select>
<input type="button" value="Show Index" onclick="showSelected();" />
</p>
<p>
<input type="text" id="txtIndex" />
selectedIndex
<br />
<input type="text" id="txtValue" />
options[].value
<br />
<input type="text" id="txtText" />
options[].text
<br />
</p>
</form>

codeexploiter
12-26-2007, 10:03 AM
<p>
<input type="text" id="txtIndex" />
selectedIndex
<br />
<input type="text" id="txtValue" />
options[].value
<br />
<input type="text" id="txtText" />
options[].text
<br />
</p>



The above section in your code seems to be incorrect.

XAKERA
12-26-2007, 10:10 AM
I tryed another java scripts and ajax scripts in ajax tab but it doesn't work but when i change rel with rel=#iframe it works great :(

ddadmin
12-27-2007, 03:57 AM
Everything you've posted so far doesn't really explain just what issue you're having with the script. Do you have a URL to the problem page on your site you can post?

XAKERA
12-27-2007, 10:30 AM
I creat site and please visit and look at the ajax tab http://xakera.we.bs/index.html. TAB 4 is in #iframe. click on the show index in field doens't show result in rel= and in #iframe it works
I want work it without #iframe thanks

XAKERA
12-27-2007, 03:39 PM
I creat site and please visit and look at the ajax tab http://xakera.we.bs/index.html. TAB 4 is in #iframe. click on the show index in field doens't show result in rel= and in #iframe it works
I want work it without #iframe thanks

ddadmin
12-28-2007, 12:40 AM
Ok, this is due to the fact that the JavaScript that manipulates the SELECT menu on upload.html (http://xakera.we.bs/upload.html) is added inside that page, rather than the main page. When a page is fetched via Ajax, any JavaScripts on that page may not be transferred over properly.

Try moving the script in question:


<script language="JavaScript" type="text/javascript">
<!--
function showSelected()
{
var selObj = document.getElementById('selSeaShells');
var txtIndexObj = document.getElementById('txtIndex');
var txtValueObj = document.getElementById('txtValue');
var txtTextObj = document.getElementById('txtText');

var selIndex = selObj.selectedIndex;
txtIndexObj.value = selIndex;
txtValueObj.value = selObj.options[selIndex].value;
txtTextObj.value = selObj.options[selIndex].text;
}
//-->
</script>

from upload.html to your main page (http://xakera.we.bs/index.html) instead.

XAKERA
12-28-2007, 08:06 AM
Thanks but This isnot problem of javascript this is problem of ajax tab :( i use ajax tab for Content and when i added some ajax function new function doesn't work. :( how fix this error? in #iframe works

ddadmin
12-28-2007, 10:32 AM
As mentioned, the problem is this: When an external page that contains JavaScript is dynamically fetched via Ajax and added to the main page, the JavaScript(s) on that page will not fire/ run, for various reasons such as them being synchronous processes. When the exact same page is fetched via IFRAME, those JavaScript(s) will fire properly, since the use of an IFRAME is equivalent to calling that external page in the browser window itself.

The solution like I said as well is already given above.

XAKERA
12-28-2007, 03:04 PM
how make to work it without iframe?

ddadmin
12-29-2007, 01:14 AM
how make to work it without iframe?

The solution as mentioned is to move the JavaScript(s) that exist on the external page onto the main page instead, so all that's contained in the external page is regular HTML.

XAKERA
12-29-2007, 08:22 AM
can u advise me what ajax tab use for ajax Content? I want make ajax site

XAKERA
12-29-2007, 03:46 PM
I add this mod in ajax tab 2 and it doesn't work :(
http://boedesign.com/posts/23.html i added this. how fix to work it