PDA

View Full Version : Ajaxtabs is undefined, but only on certain IIS machines.



Paulus Cliftus
03-17-2008, 12:37 PM
Script Title: Ajax Tabs

Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm

Describe problem: Hi, I know this is not a problem with the script, but more how we have our IIS setup. When running our website on a windows 2000 sp4 IIS server the script runs fine. But when we try it on a xp pro IIS server I get the error -

ddajaxtabs is undefined

on this line -


var tabs=new ddajaxtabs("admintabs", "admincontainter")

both sites have exactly the same files so that is not a problem, I'm guessing the problem is something IIS related but I've looked and looked and cannot see anything obvious.

If someone could put me out of my misery on this one I'd be most grateful :D

Regards

Paul Clift

ddadmin
03-17-2008, 11:33 PM
I don't know ASP, but in general, the checklist for using any server side language to dynamically output client side JavaScripts is the same. As long as what gets output to the browser conforms to the syntax/ conventions of the client side script, as if you've manually added it to the page, it should work. Please post a link to the page on your site that contains the problematic script so we can check it out.

Paulus Cliftus
03-18-2008, 07:31 AM
http://www.daventrybreakfastclub.co.uk/admin.asp

Not sure if that link will help, as if you are not an admin it auto redirects back to home.asp


That's the page source if I navigate there while logged in though, this is on a IIS server where its working.



<html>
<head>
<noscript>
<meta http-equiv="REFRESH" content="0;url=nojs.asp">
</noscript>
<title>Daventry Breakfast Club</title>

<link rel='stylesheet' href='css/styles.css' type='text/css' />

<script type="text/javascript" src="js/ajaxtabs.js">

/***********************************************
* Ajax Tabs Content script v2.0- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

</script>

<style type='text/css'>

.tabcontentiframe{
height: 775px !important;
}

body
{
background-image: url(images/extendABLEtophalf.gif);
background-repeat: no-repeat;
}
</style>

</head>


<body>


<div id='header'>
</div>

<div id='navstandard'>


<div class='nav1'><a href='home.asp'>&nbsp;</a></div>




<div class='nav2'><a href='meetings.asp'>&nbsp;</a></div>




<div class='nav3'><a href='news.asp?qyear=2008&qmonth='>&nbsp;</a></div>




<div class='nav4'><a href='members.asp'>&nbsp;</a></div>




<div class='nav5'><a href='daventry.asp'>&nbsp;</a></div>



<div class='nav6'><a href='contact.asp'>&nbsp;</a></div>
<div class='nav7'><a href='admin.asp'>&nbsp;</a></div>
</div>

<div id='contentstandard'>

<div id='contentheader' class='PageTitle'>
Admin<br>
<span class="text"><a href="home.asp?action=logout">Logout</a></span> </div>


<br><br><br>
<ul id="admintabs" class="shadetabs">

<li><a href="adminTypes.asp?action=view" rel="#iframe">Miscellaneous</a></li>

<li><a href="adminmembers.asp?AID=1" rel="#iframe">Members</a></li>

<li><a href="adminNews.asp" rel="#iframe">News</a></li>

<li><a href="adminlocations.asp" rel="#iframe">Venues</a></li>

</ul>

<div id="admincontainter" style="background-color:#FFFFFF; border:1px solid gray; width:600px; height:750px; margin-bottom: 1em; padding: 10px">
<p>Site Admin Page</p>
</div>

<script type="text/javascript">

var tabs=new ddajaxtabs("admintabs", "admincontainter")
tabs.setpersist(false)
tabs.setselectedClassTarget("linkparent") //"link" or "linkparent"
tabs.init()

</script>
</div>
</body>
</html>

ddadmin
03-18-2008, 11:47 AM
Well, since I'm redirected, it negates the link being useful. But looking at the source of what you posted, it's valid and should work. In fact, if I copy/paste it, then replace the pages you're loading (ie: adminNews.asp) with my own, clicking on the tabs loads them correctly...

Strangeplant
03-18-2008, 08:00 PM
Yes, there is a problem with your IIS - it's a security thing. Quoting from a text:
In the case
where you want the XMLHTTPRequest to retrieve data from a service running
on your server you can bind your service to a particular port. Then also have
your service serve up your html page. That way you can do an IFRAME on
your main page which contacts your service to serve up an html page, with
the XMLHTTPRequest object which contacts your service again on the same
port to get the data your service is serving up.

For example, http://localhost/ has <iframe
src=”http://localhost:10102/?htmlpage”></iframe> which contacts your
service that is binding on port 10102. The service then serves up whatever
html page that you want. In the html page that is served up, a
XMLHTTPRequest object contacts the server again an initiates an HTTP GET
request to http://localhost:10102/?data. In this way you can bypass port
restrictions and get the information that you need from another
port.The link to this is: http://www.nathanm.com/ajax-bypassing-xmlhttprequest-cross-domain-restriction/

kaoru
06-18-2009, 03:38 AM
But when we try it on a xp pro IIS server I get the error -

ddajaxtabs is undefined

on this line -



I have Windows 7 beta, ddajaxtabs is undefined happened as well through IIS http://localhost/

I have tested same files under XP professional IIS, it works fine.
It must be something about Windows 7, but I don't how to fix it.

ddadmin
06-18-2009, 06:38 AM
Kaoru, what happens when you run the script online, and not localhost?