Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help mixing Javascript and Coldfusion

Status
Not open for further replies.

LyndonOHRC

Programmer
Sep 8, 2005
603
US
I'm using a javascript menu that I like a lot but I have to load the menus values manually.

I would like to move the portion that loads the array of values from the js file it is in to a cfm template and eventually load those values from a database.

The code below is how I'm attempting to do it but gets an error not finding the js functions in the next module (menu_com.js). I thought the cfinclude and script src= tags would just place the code in the template but it doesn't seem to work that way.

This code works fine:
Code:
<script type='text/javascript'>
    //HV Menu v5.411- by Ger Versluis ([URL unfurl="true"]http://www.burmees.nl/)[/URL]
    //Submitted to Dynamic Drive ([URL unfurl="true"]http://www.dynamicdrive.com)[/URL]
    //Visit [URL unfurl="true"]http://www.dynamicdrive.com[/URL] for this script and more
    function Go(){return}
</script>

<!--- --->
<script type='text/javascript' src='/binkleyhome/exmplmenu_var.js'>

</script>


<!--- <cfinclude template="/binkleyhome/exmplmenu_var.cfm"> --->
<script type='text/javascript' src='/binkleyhome/menu_com.js'>
    
</script>
I placed the contents of exmplmenu_var.js in the cfm and wrapped it in a script tag. Then I moved the comment tags from the cfinclude to the script tag.

Contents of exmplmenu_var.cfm:
Code:
<script type='text/javascript' language="JavaScript">
<!--- 

/***********************************************************************************
*    (c) Ger Versluis 2000 version 5.411 24 December 2001 (updated Jan 31st, 2003 by Dynamic Drive for Opera7)
*    For info write to menus@burmees.nl                  *
*    You may remove all comments for faster loading              *        
***********************************************************************************/

    var NoOffFirstLineMenus=9;            // Number of first level items
    var LowBgColor='white';            // Background color when mouse is not over
    var LowSubBgColor='white';            // Background color when mouse is not over on subs
    var HighBgColor='Yellow';            // Background color when mouse is over
    var HighSubBgColor='Yellow';            // Background color when mouse is over on subs
    var FontLowColor='RoyalBlue';            // Font color when mouse is not over
    var FontSubLowColor='RoyalBlue';            // Font color subs when mouse is not over
    var FontHighColor='DarkBlue';            // Font color when mouse is over
    var FontSubHighColor='DarkBlue';            // Font color subs when mouse is over
    var BorderColor='DodgerBlue';            // Border color
    var BorderSubColor='DodgerBlue';            // Border color for subs
    var BorderWidth=1;                // Border width
    var BorderBtwnElmnts=0;            // Border between elements 1 or 0
    var FontFamily="arial,comic sans ms,technical"    // Font family menu items
    var FontSize=9;                // Font size menu items
    var FontBold=1;                // Bold menu items 1 or 0
    var FontItalic=0;                // Italic menu items 1 or 0
    var MenuTextCentered='left';            // Item text position 'left', 'center' or 'right'
    var MenuCentered='center';            // Menu horizontal position 'left', 'center' or 'right'
    var MenuVerticalCentered='top';        // Menu vertical position 'top', 'middle','bottom' or static
    var ChildOverlap=.2;                // horizontal overlap child/ parent
    var ChildVerticalOverlap=.2;            // vertical overlap child/ parent
    var StartTop=1;                // Menu offset x coordinate
    var StartLeft=1;                // Menu offset y coordinate
    var VerCorrect=0;                // Multiple frames y correction
    var HorCorrect=0;                // Multiple frames x correction
    var LeftPaddng=1;                // Left padding
    var TopPaddng=2;                // Top padding
    var FirstLineHorizontal=1;            // SET TO 1 FOR HORIZONTAL MENU, 0 FOR VERTICAL
    var MenuFramesVertical=1;            // Frames in cols or rows 1 or 0
    var DissapearDelay=100;            // delay before menu folds in
    var TakeOverBgColor=1;            // Menu frame takes over background color subitem frame
    var FirstLineFrame='navig';            // Frame where first level appears
    var SecLineFrame='space';            // Frame where sub levels appear 
    var DocTargetFrame='space';            // Frame where target documents appear
    var TargetLoc='';                // span id for relative positioning
    var HideTop=0;                // Hide first level when loading new document 1 or 0
    var MenuWrap=1;                // enables/ disables menu wrap 1 or 0
    var RightToLeft=0;                // enables/ disables right to left unfold 1 or 0
    var UnfoldsOnClick=0;            // Level 1 unfolds onclick/ onmouseover
    var WebMasterCheck=1;            // menu tree checking on or off 1 or 0
    var ShowArrow=1;                // Uses arrow gifs when 1
    var KeepHilite=1;                // Keep selected path highligthed
    var Arrws=['[URL unfurl="true"]http://www.ohrc.org/binkley/tri.gif',5,10,'http://www.ohrc.org/binkley/tridown.gif',10,5,'http://www.ohrc.org/binkley/trileft.gif',5,10[/URL]];    // Arrow source, width and height

function BeforeStart(){return}
function AfterBuild(){return}
function BeforeFirstOpen(){return}
function AfterCloseAll(){return}


// Menu tree
//    MenuX=new Array(Text to show, Link, background image (optional), number of sub elements, height, width);
//    For rollover images set "Text to show" to:  "rollover:Image1.jpg:Image2.jpg"

Menu1=new Array("Home","[URL unfurl="true"]http://www.ohrc.org/binkley","",2,20,65);[/URL]
    Menu1_1=new Array("Log-Out","[URL unfurl="true"]http://www.ohrc.org/Binkley/Logout.cfm","",0,20,140);[/URL]    
    Menu1_2=new Array("Database Maintenance","[URL unfurl="true"]http://www.ohrc.org/binkley/admin/home.cfm","",0,20,100);[/URL]    
Menu2=new Array("License","[URL unfurl="true"]http://www.ohrc.org/Binkley/LicenseIndexSearch/Search.cfm","",5,20,65);[/URL]
    Menu2_1=new Array("Data Entry","[URL unfurl="true"]http://www.ohrc.org/Binkley/License/Home.cfm","",3,20,150);[/URL]    
        Menu2_1_1=new Array("Licensees Data Entry","[URL unfurl="true"]http://www.ohrc.org/Binkley/License/Home.cfm","",0,20,150);[/URL]
        Menu2_1_2=new Array("Lease Data Entry","[URL unfurl="true"]http://www.ohrc.org/Binkley/Lease/Home.cfm","",0,20,150);[/URL]
        Menu2_1_3=new Array("Multi Data Entry","[URL unfurl="true"]http://www.ohrc.org/Binkley/Multi/Home.cfm","",0,20,150);[/URL]        
    Menu2_2=new Array("Inquiries","[URL unfurl="true"]http://www.ohrc.org/Binkley/LicenseIndexSearch/Search.cfm","",7,20,150);[/URL]    
        Menu2_2_1=new Array("Licensees by Year","[URL unfurl="true"]http://www.ohrc.org/Binkley/LicenseIndexSearch/Search.cfm","",0,20,150);[/URL]
        Menu2_2_2=new Array("Licenses All Years","[URL unfurl="true"]http://www.ohrc.org/Binkley/AllYears/Search.cfm","",0,20,150);[/URL]
        Menu2_2_3=new Array("Leases","[URL unfurl="true"]http://www.ohrc.org/Binkley/LeaseLocate/Search.cfm","",0,20,150);[/URL]
        Menu2_2_4=new Array("Multi-Owners by Year","[URL unfurl="true"]http://www.ohrc.org/Binkley/MultiLocate/Search.cfm","",0,20,150);[/URL]
        Menu2_2_5=new Array("Multi-Owners All Years","[URL unfurl="true"]http://www.ohrc.org/Binkley/MultiLocate/SearchAll.cfm","",0,20,150);[/URL]
        Menu2_2_6=new Array("Employers","[URL unfurl="true"]http://www.ohrc.org/Binkley/License/Employers/Search.cfm","",0,20,150);[/URL]
        Menu2_2_7=new Array("Gaming License","[URL unfurl="true"]http://www.ohrc.org/Binkley/LicenseIndexSearch/GamingSearch.cfm","",0,20,150);[/URL]
    Menu2_3=new Array("Reports","blank.htm","",16,20,185);
        Menu2_3_1=new Array("Licensee Lists by Type","[URL unfurl="true"]http://www.ohrc.org/Binkley/LicenseIndexSearch/Reports/LicenseeTypeListMenu.cfm","",0,20,185);[/URL]
        Menu2_3_2=new Array("Lease List","[URL unfurl="true"]http://www.ohrc.org/Binkley/LicenseIndexSearch/reports/LeaseListMenu.cfm","",0,20,150);[/URL]
        Menu2_3_3=new Array("Multi List","[URL unfurl="true"]http://www.ohrc.org/Binkley/LicenseIndexSearch/reports/MultiListMenu.cfm","",0,20,150);[/URL]
        Menu2_3_4=new Array("Licensee Stats - YTD Sales","[URL unfurl="true"]http://www.ohrc.org/Binkley/LicenseIndexSearch/reports/StatisticsMenu.cfm","",0,20,150);[/URL]
        Menu2_3_5=new Array("Licensee Stats - Curent","[URL unfurl="true"]http://www.ohrc.org/Binkley/LicenseIndexSearch/reports/StatisticsMenuCurrent.cfm","",0,20,150);[/URL]
        Menu2_3_6=new Array("Licensee Directories","[URL unfurl="true"]http://www.ohrc.org/Binkley/LicenseIndexSearch/reports/DirectoryMenu.cfm","",0,20,150);[/URL]
        Menu2_3_7=new Array("Spouse List by Spouse Name","[URL unfurl="true"]http://www.ohrc.org/Binkley/LicenseIndexSearch/reports/SpouseListSPMenu.cfm","",0,20,150);[/URL]
        Menu2_3_8=new Array("Spouse List by Licensee Name","[URL unfurl="true"]http://www.ohrc.org/Binkley/LicenseIndexSearch/reports/SpouseListOWNMenu.cfm","",0,20,150);[/URL]
        Menu2_3_9=new Array("Jockey Physical List","[URL unfurl="true"]http://www.ohrc.org/Binkley/LicenseIndexSearch/reports/JockeyListMenu.cfm","",0,20,150);[/URL]
        Menu2_3_10=new Array("OHRC License List One","[URL unfurl="true"]http://www.ohrc.org/Binkley/LicenseIndexSearch/reports/LicenseListOneMenu.cfm","",0,20,150);[/URL]
        Menu2_3_11=new Array("OHRC License List Two","[URL unfurl="true"]http://www.ohrc.org/Binkley/LicenseIndexSearch/reports/LicenseListTwoMenu.cfm","",0,20,150);[/URL]
        Menu2_3_12=new Array("Bookeeper License List","[URL unfurl="true"]http://www.ohrc.org/Binkley/LicenseIndexSearch/reports/LicenseBookkeeperListMenu.cfm","",0,20,185);[/URL]
        Menu2_3_13=new Array("Licensing Statistical Matrix","[URL unfurl="true"]http://www.ohrc.org/Binkley/LicenseIndexSearch/reports/StatsMatrixMenu.cfm","",0,20,150);[/URL]
        Menu2_3_14=new Array("Scanned License Lists","[URL unfurl="true"]http://www.ohrc.org/Binkley/LicenseIndexSearch/reports/ScannedLicenseLists.cfm","",0,20,150);[/URL]
        Menu2_3_15=new Array("Pending Licensees","[URL unfurl="true"]http://www.ohrc.org/Binkley/LicenseIndexSearch/reports/PendingLicenseesReport.cfm","",0,20,150);[/URL]
        Menu2_3_16=new Array("Pending Multis","[URL unfurl="true"]http://www.ohrc.org/Binkley/LicenseIndexSearch/reports/PendingMultisReport.cfm","",0,20,150);[/URL]
    Menu2_4=new Array("Locate","[URL unfurl="true"]http://www.ohrc.org/Binkley/LicenseIndexSearch/Locate/home.cfm","",0,20,150);[/URL]
    Menu2_5=new Array("Reciprocity Management","[URL unfurl="true"]http://www.ohrc.org/Binkley/Reciprocity/home.cfm","",0,20,150);[/URL]
Menu3=new Array("Track","[URL unfurl="true"]http://www.ohrc.org/binkley/trackdata/home.cfm","",9,20,65);[/URL]
    Menu3_1=new Array("Menu","[URL unfurl="true"]http://www.ohrc.org/binkley/trackdata/home.cfm","",0,20,150);[/URL]
    Menu3_2=new Array("License Data","[URL unfurl="true"]http://www.ohrc.org/binkley/trackdata/home.cfm","",3,20,150);[/URL]
        Menu3_2_1=new Array("Print License List","[URL unfurl="true"]http://www.ohrc.org/binkley/trackdata/RemLicData.cfm","",0,20,150);[/URL]
        Menu3_2_2=new Array("Search/Edit License Data","[URL unfurl="true"]http://www.ohrc.org/binkley/trackdata/RemLicSearch.cfm?alphaindex=A","",0,20,150);[/URL]
        Menu3_2_3=new Array("Add License Data","[URL unfurl="true"]http://www.ohrc.org/Binkley/AllYears/Search.cfm","",0,20,150);[/URL]
    Menu3_3=new Array("Multi-Owner Data","[URL unfurl="true"]http://www.ohrc.org/binkley/trackdata/home.cfm","",3,20,150);[/URL]
        Menu3_3_1=new Array("Print Multi List","[URL unfurl="true"]http://www.ohrc.org/binkley/trackdata/RemMulData.cfm","",0,20,150);[/URL]
        Menu3_3_2=new Array("Search/Edit Multi Data","[URL unfurl="true"]http://www.ohrc.org/binkley/trackdata/RemMulSearch.cfm?alphaindex=A","",0,20,150);[/URL]
        Menu3_3_3=new Array("Add Multi Data","[URL unfurl="true"]http://www.ohrc.org/Binkley/MultiLocate/SearchAll.cfm","",0,20,150);[/URL]
    Menu3_4=new Array("Track List Maintenance","[URL unfurl="true"]http://www.ohrc.org/binkley/trackdata/tracklist.cfm","",0,20,150);[/URL]
    Menu3_5=new Array("Horse Tracking","[URL unfurl="true"]http://www.ohrc.org/binkley/trackdata/HorseTracking.cfm","",9,20,150);[/URL]
        Menu3_5_1=new Array("Menu","[URL unfurl="true"]http://www.ohrc.org/binkley/trackdata/HorseTracking.cfm","",0,20,150);[/URL]
        Menu3_5_2=new Array("Add New Horse","[URL unfurl="true"]http://www.ohrc.org/binkley/trackdata/HorseAdd.cfm","",0,20,150);[/URL]
        Menu3_5_3=new Array("Search/Edit Horses","[URL unfurl="true"]http://www.ohrc.org/binkley/trackdata/HorseSearch.cfm","",0,20,150);[/URL]
        Menu3_5_4=new Array("On List Report","[URL unfurl="true"]http://www.ohrc.org/binkley/trackdata/HorseReportOnList.cfm","",0,20,150);[/URL]
        Menu3_5_5=new Array("Off List Report","[URL unfurl="true"]http://www.ohrc.org/binkley/trackdata/HorseReportOffList.cfm","",0,20,150);[/URL]
        Menu3_5_6=new Array("Off Back On Report","[URL unfurl="true"]http://www.ohrc.org/binkley/trackdata/HorseReportOffOnList.cfm","",0,20,150);[/URL]
        Menu3_5_7=new Array("Daily Report","[URL unfurl="true"]http://www.ohrc.org/binkley/trackdata/HorseDailyReport.cfm","",0,20,150);[/URL]
        Menu3_5_8=new Array("Orphan Event Report","[URL unfurl="true"]http://www.ohrc.org/binkley/trackdata/HorseOrphansList.cfm","",0,20,150);[/URL]
        Menu3_5_9=new Array("Add Horse Colors","[URL unfurl="true"]http://www.ohrc.org/binkley/trackdata/HorseColor.cfm","",0,20,150);[/URL]
    Menu3_6=new Array("Gaming Receipt","[URL unfurl="true"]http://www.ohrc.org/binkley/gaming/AccountingRecieptsMenu.cfm","",0,20,150);[/URL]
    Menu3_7=new Array("Daily Deposit Report","[URL unfurl="true"]http://www.ohrc.org/binkley/trackdata/DailyReportMenu.cfm","",0,20,150);[/URL]
    Menu3_8=new Array("Daily Deposit Extended Report","[URL unfurl="true"]http://www.ohrc.org/binkley/trackdata/DailyReportExtendedMenu.cfm","",0,20,150);[/URL]
    Menu3_9=new Array("Monthly Deposit Report","[URL unfurl="true"]http://www.ohrc.org/binkley/trackdata/MonthlyReportMenu.cfm","",0,20,150);[/URL]
Menu4=new Array("Registry","[URL unfurl="true"]http://www.ohrc.org/binkley/Agents/default.cfm","",11,20,65);[/URL]
    Menu4_1=new Array("Menu","[URL unfurl="true"]http://www.ohrc.org/binkley/Agents/default.cfm","",0,20,170);[/URL]
    Menu4_2=new Array("Locate Registered Foals","[URL unfurl="true"]http://www.ohrc.org/binkley/Agents/RegSubmenu.cfm","",4,20,150);[/URL]
        Menu4_2_1=new Array("Menu","[URL unfurl="true"]http://www.ohrc.org/binkley/Agents/RegSubmenu.cfm","",0,20,150);[/URL]
        Menu4_2_2=new Array("Locate by Foal Name","[URL unfurl="true"]http://www.ohrc.org/binkley/Agents/RegFoalSearch.cfm","",0,20,150);[/URL]
        Menu4_2_3=new Array("Locate by Sire Name","[URL unfurl="true"]http://www.ohrc.org/binkley/Agents/RegSireSearch.cfm","",0,20,150);[/URL]
        Menu4_2_4=new Array("Locate by Dam Name","[URL unfurl="true"]http://www.ohrc.org/binkley/Agents/RegDamSearch.cfm","",0,20,150);[/URL]
    Menu4_3=new Array("Locate Pending Foals","[URL unfurl="true"]http://www.ohrc.org/binkley/Agents/PendSubMenu.cfm","",4,20,160);[/URL]
        Menu4_3_1=new Array("Menu","[URL unfurl="true"]http://www.ohrc.org/binkley/Agents/PendSubmenu.cfm","",0,20,160);[/URL]
        Menu4_3_2=new Array("Locate by Foal Name","[URL unfurl="true"]http://www.ohrc.org/binkley/Agents/PendFoalSearch.cfm","",0,20,160);[/URL]
        Menu4_3_3=new Array("Locate by Dam Name","[URL unfurl="true"]http://www.ohrc.org/binkley/Agents/PendDamSearch.cfm","",0,20,160);[/URL]
        Menu4_3_4=new Array("Locate by Owner Last Name","[URL unfurl="true"]http://www.ohrc.org/binkley/Agents/PendLNameSearch.cfm","",0,20,160);[/URL]
    Menu4_4=new Array("Print Accredited OKB List","[URL unfurl="true"]http://www.ohrc.org/binkley/Agents/RegistryListQuery.cfm","",0,20,160);[/URL]
    Menu4_5=new Array("Print Awards Chart","[URL unfurl="true"]http://www.ohrc.org/registry/AwardsChart.cfm","",0,20,160);[/URL]
    Menu4_6=new Array("Print Registered Stock Totals Chart","[URL unfurl="true"]http://www.ohrc.org/registry/StockCountChart.cfm","",0,20,170);[/URL]
    Menu4_7=new Array("Print OKB Status Reoprt","[URL unfurl="true"]http://www.ohrc.org/registry/NewStatusReportMenu.cfm","",0,20,170);[/URL]
    Menu4_8=new Array("Print OKB Owners by State Reoprt","[URL unfurl="true"]http://www.ohrc.org/binkley/registry/ownersbystate.cfm","",0,20,170);[/URL]
    Menu4_9=new Array("Print Double Registered Foals Reoprt","[URL unfurl="true"]http://www.ohrc.org/binkley/registry/DoubleRegisteredFoals.cfm","",0,20,170);[/URL]
    Menu4_10=new Array("Add/Edit Registry Data","[URL unfurl="true"]http://www.ohrc.org/registry/","",10,20,150);[/URL]
        Menu4_10_1=new Array("Menu","[URL unfurl="true"]http://www.ohrc.org/registry","",0,20,150);[/URL]
        Menu4_10_2=new Array("Race Stock","[URL unfurl="true"]http://www.ohrc.org/registry/RaceStockSearch.cfm","",0,20,150);[/URL]
        Menu4_10_3=new Array("Broodmares","[URL unfurl="true"]http://www.ohrc.org/registry/BroodmareSearch.cfm?srow=1&mmaxrows=10&maddresses=Off&morder=BMName&msearchvalue=&HideOldBroads=Yes","",0,20,150);[/URL]
        Menu4_10_4=new Array("Stallions","[URL unfurl="true"]http://www.ohrc.org/registry/StallionSearch.cfm","",0,20,150);[/URL]
        Menu4_10_5=new Array("Workorders","[URL unfurl="true"]http://www.ohrc.org/registry/WorkorderSearch.cfm","",0,20,150);[/URL]
        Menu4_10_6=new Array("Pending Race Stock","[URL unfurl="true"]http://www.ohrc.org/registry/PRacestockSearch.cfm","",0,20,150);[/URL]
        Menu4_10_7=new Array("Pending Broodmares","[URL unfurl="true"]http://www.ohrc.org/registry/PBroodmareSearch.cfm","",0,20,150);[/URL]
        Menu4_10_8=new Array("Pending Stallions","[URL unfurl="true"]http://www.ohrc.org/registry/PStallionSearch.cfm","",0,20,150);[/URL]
        Menu4_10_9=new Array("Address Change Tool","[URL unfurl="true"]http://www.ohrc.org/registry/AddressChange.cfm","",0,20,150);[/URL]
        Menu4_10_10=new Array("Undelete Records","[URL unfurl="true"]http://www.ohrc.org/registry/DeletedPending.cfm?ptype=sire","",0,20,150);[/URL]        
    Menu4_11=new Array("Daily Deposit Report","[URL unfurl="true"]http://www.ohrc.org/registry/DailyDepositReportMenu.cfm","",0,20,150);[/URL]
Menu5=new Array("Law","[URL unfurl="true"]http://www.ohrc.org/stoplist/home.cfm","",6,20,70);[/URL]
    Menu5_1=new Array("Menu","[URL unfurl="true"]http://www.ohrc.org/stoplist/home.cfm","",0,20,120);[/URL]
    Menu5_2=new Array("Gaming Database","[URL unfurl="true"]http://www.ohrc.org/binkley/gaming/home.cfm","",4,20,120);[/URL]
        Menu5_2_1=new Array("Applications","[URL unfurl="true"]http://www.ohrc.org/binkley/gaming/License.cfm","",0,20,120);[/URL]
        Menu5_2_2=new Array("Reports","[URL unfurl="true"]http://www.ohrc.org/binkley/gaming/Reports.cfm","",0,20,120);[/URL]
        Menu5_2_3=new Array("Accounting","[URL unfurl="true"]http://www.ohrc.org/binkley/gaming/Accounting.cfm","",0,20,120);[/URL]
        Menu5_2_4=new Array("Maintenance","[URL unfurl="true"]http://www.ohrc.org/binkley/gaming/SystemMaintenance.cfm","",0,20,120);[/URL]
    Menu5_3=new Array("Referrals","[URL unfurl="true"]http://www.ohrc.org/stoplist/home.cfm","",2,20,120);[/URL]
        Menu5_3_1=new Array("Search","[URL unfurl="true"]http://www.ohrc.org/stoplist/SearchPage_A.cfm","",0,20,120);[/URL]
        Menu5_3_2=new Array("Print","[URL unfurl="true"]http://www.ohrc.org/stoplist/PrintStopList.cfm","",0,20,120);[/URL]
    Menu5_4=new Array("Felony Approved","[URL unfurl="true"]http://www.ohrc.org/stoplist/home.cfm","",2,20,120);[/URL]
        Menu5_4_1=new Array("Search","[URL unfurl="true"]http://www.ohrc.org/stoplist/SearchPageFelony_A.cfm","",0,20,120);[/URL]
        Menu5_4_2=new Array("Print","[URL unfurl="true"]http://www.ohrc.org/stoplist/PrintFelonyList.cfm","",0,20,120);[/URL]
    Menu5_5=new Array("Scanned Orders","[URL unfurl="true"]http://www.ohrc.org/stoplist/ScannedOrders.cfm","",0,20,120);[/URL]
    Menu5_6=new Array("Farm Locator","[URL unfurl="true"]http://www.ohrc.org/registry/FarmLocatorMenu.cfm","",0,20,120);[/URL]
Menu6=new Array("Claims","[URL unfurl="true"]http://www.ohrc.org/binkley/claims/home.cfm","",3,20,65);[/URL]
    Menu6_1=new Array("Menu","[URL unfurl="true"]http://www.ohrc.org/binkley/claims/Home.cfm","",0,20,230);[/URL]
    Menu6_2=new Array("Reports","[URL unfurl="true"]http://www.ohrc.org/binkley/claims/reports.cfm","",2,20,230);[/URL]
        Menu6_2_1=new Array("Horse of The Year Reports","[URL unfurl="true"]http://www.ohrc.org/binkley/claims/hoy.cfm","",0,20,120);[/URL]
        Menu6_2_2=new Array("Complete Stock List","[URL unfurl="true"]http://www.ohrc.org/binkley/claims/StockList.cfm","",0,20,120);[/URL]
    Menu6_3=new Array("Employee/Claims/Years of Service Menu","[URL unfurl="true"]http://www.ohrc.org/binkley/claims/EmployeeMenu.cfm","",0,20,220);[/URL]
Menu7=new Array("Forms","[URL unfurl="true"]http://www.ohrc.org/binkley/admin/documents.cfm","",2,20,65);[/URL]
    Menu7_1=new Array("Interoffice Forms","[URL unfurl="true"]http://www.ohrc.org/binkley/Admin/documents.cfm","",0,20,145);[/URL]
    Menu7_2=new Array("Public Application Forms","[URL unfurl="true"]http://www.ohrc.org/FORMS2.HTML","",0,20,145);[/URL]
Menu8=new Array("Admin","[URL unfurl="true"]http://www.ohrc.org/binkley","",4,20,65);[/URL]
    Menu8_1=new Array("Users Rights","[URL unfurl="true"]http://www.ohrc.org/usermanagement","",0,20,180);[/URL]
    Menu8_2=new Array("E-Mail","[URL unfurl="true"]http://www.ohrc.org/Binkley/email.cfm","",0,20,120);[/URL]
    Menu8_3=new Array("Manage Scanned Documents","[URL unfurl="true"]http://www.ohrc.org/Binkley/ScanMan/Home.cfm","",0,20,240);[/URL]
    Menu8_4=new Array("Commissioners Documents","[URL unfurl="true"]http://www.ohrc.org/Commissioners.cfm?FromBinkley=1</cfoutput>","",0,20,240);[/URL]
Menu9=new Array("Links","[URL unfurl="true"]http://www.ohrc.org/binkley","",3,20,65);[/URL]
    Menu9_1=new Array("OHRC Home Page","[URL unfurl="true"]http://www.ohrc.org","",0,20,130);[/URL]
    Menu9_2=new Array("OHRC Public Data","[URL unfurl="true"]http://www.ohrc.org/publicdata","",0,20,100);[/URL]
    Menu9_3=new Array("ARCI Database","[URL unfurl="true"]http://www.arcimembers.com/","",0,20,100);[/URL]


 --->
</script>

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
I'm not sure how the cfinclude works, as I don't use coldfusion. However, what I read from google says that the cfinclude takes a cold fusion page as a parameter. Perhaps the page you're importing needs more than just the script tags?

I personally would take a different approach to this. Since all you are wanting to pull into the page is javascript, why not stick it all in a js file and pull it in with a script tag like so:
Code:
<script type='text/javascript' src='myImportedJS.js'>

If you take this route remember that .js files do not require <script> tags, so be sure to take them out first.

If this solution will not work for you for whatever reason, maybe try using server side includes instead (provided your server supports them). Something like this would work:
Code:
<!--#include File="exmplmenu_var.cfm"-->

Using server side includes is the exact same as copying/pasting the code from the include straight into the main page.

-kaht

[small](All puppies have now found loving homes, thanks for all who showed interest)[/small]
 
How would I fill this array with values
from a data source in your solution?

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
CFInclude works like a preprocessor include
directive in C. The tag is replaced by the
template contents before any code is evaluated.

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
Sorry, I don't know a lick of coldfusion, but were you populating the arrays from a data source in the example you posted above? It looks like all the values are static. If that is what you're trying to accomplish then importing the code via a <script> tag will not work, although server side includes would.

I'd suggest taking this to the cold fusion forum because it doesn't seem like you're looking for a javascript solution, but rather a cold fusion solution for a javascript problem.

-kaht

[small](All puppies have now found loving homes, thanks for all who showed interest)[/small]
 
CFInclude works like a preprocessor include
directive in C

Man.... you gotta speak the javascript language in the javascript forum, I haven't taken a C class for about 8 years [smile]

-kaht

[small](All puppies have now found loving homes, thanks for all who showed interest)[/small]
 
Sorry for the probable crosspost.

I'm struggling with which fourm might help.

kaht, I hadn't tried to populate the array yet.

I was trying to get the concept to work
with hard coded values in the array.



Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
It sounds like server side includes should work either way you're trying to do it, static values or pulled from a database. I use them in ASP all the time, and they are not ASP specific.

-kaht

[small](All puppies have now found loving homes, thanks for all who showed interest)[/small]
 
You don't need a cfinclude to include javascript, but this code works for me.
Code:
<cfinclude template="layoutInfo.cfm">

Make sure you have the right path, you can check your path by using
Code:
<cfoutput>#GetCurrentTemplatePath()#</cfoutput>

[qoute]I would like to move the portion that loads the array of values from the js file it is in to a cfm template and eventually load those values from a database.[/qoute]

to do this you can cfquery or call a stored proc get the recordset and loop through the recordset creating a string that will be your javascript and return it from a function to the main page or just directly output it.
Direct output example below cause its easiest.

Code:
<script type='text/javascript'>
var myArray = new Array()
<cfloop from="1" to="#myQuery.recordCount#" index="i">
  <cfoutput>myArray[#i#] = #myQuery.arrayValue[i]#</cfoutput>
</cfloop>
</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top