India seo web development website designer freelance

A simple dynamic menu

The following menu command generates the Preview in Browser submenu, and it launches the current file (or the selected files in the Site panel) in the browser that the user chooses from the submenu.

<HTML> <HEAD> <!-- Copyright 1999 , Inc. All rights reserved. --> <TITLE>Preview Browsers</TITLE> <SCRIPT LANGUAGE="javascript"> <!-- // getDynamicContent returns the contents of a dynamically // generated menu. // returns an array of strings to be placed in the menu, with a unique // identifier for each item separated from the menu string by a // semicolon. // // return null from this routine to indicate that you are not // adding any // items to the menu function getDynamicContent(itemID) { var browsers = null; var PIB = null; var i; var j=0; var bUpdate = dw.getMenuNeedsUpdating(itemID); if (bUpdate) { browsers = new Array(); PIB = dw.getBrowserList(); // each browser pair has the name of the browser and the path // that leads to the application on disk. We only put the // names in the menus. for (i=0; i<PIB.length; i=i+2) { browsers[j] = new String(PIB[i]); if (dw.getPrimaryBrowser() == PIB[i+1]) browsers[j] += "\tF12"; if (navigator.platform == "MacPPC") { if (dw.getSecondaryBrowser() == PIB[i+1]) browsers[j] += "\t ?F12"; } else { if (dw.getSecondaryBrowser() == PIB[i+1]) browsers[j] += "\t Ctrl+F12"; } browsers[j] += ";id='"+PIB[i]+"'"; j = j+1; } dw.notifyMenuUpdated(itemID, "dw.getBrowserList()"); } return browsers; } function canAcceptCommand() { var bHaveDocument; if (dw.getFocus() == 'site') bHaveDocument = site.getSelection().length > 0; else bHaveDocument = dw.getDocumentDOM('document') != null; return bHaveDocument; } function receiveArguments() { var theBrowser = arguments[0]; if (dw.getFocus() == 'site') dw.browseDocument(site.getSelection(),theBrowser); else dw.browseDocument(dw.getDocumentPath('document'),theBrowser); } // --> </SCRIPT> </HEAD> <BODY> </BODY> </HTML>

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117

India web developer website development India