Difference between revisions of "Template:Main2017"

Line 16: Line 16:
 
var list_of_menus = [ "Competition" , "Resources", "Community" ] ;
 
var list_of_menus = [ "Competition" , "Resources", "Community" ] ;
 
var found_the_menu = false;
 
var found_the_menu = false;
 +
var count =0;
  
 
for ( i=0; i< list_of_menus.length; i++) {
 
for ( i=0; i< list_of_menus.length; i++) {
if ( ( wgPageName.match( /list_of_menus[i]/g ) || [ ] ).length == 1  ) {   
+
 
 +
console.log (wgPageName);
 +
console.log(list_of_menus[i] );
 +
console.log ((wgPageName.match(/list_of_menus[i]/g) || []).length);
 +
 
 +
count = (wgPageName.match(/list_of_menus[i]/g) || []).length;
 +
 
 +
if (  count  == 1  ) {   
 
load_menu ( list_of_menus[i] );
 
load_menu ( list_of_menus[i] );
 
found_the_menu = true;
 
found_the_menu = true;
Line 34: Line 42:
  
 
// the full url is summed to the div id that holds that specific menu
 
// the full url is summed to the div id that holds that specific menu
 
 
 
$( "#load_menu_here" ).load( "https://2017.igem.org/HQ:Menu"+" "+"#"+ div_to_load , function() {
 
$( "#load_menu_here" ).load( "https://2017.igem.org/HQ:Menu"+" "+"#"+ div_to_load , function() {
 
 

Revision as of 19:32, 15 November 2016