Posts Tagged ‘firefox’

The non-DOM property innerHTML can’t add options to a tag select in Internet Explorer.

Example not working:

document.getElementById("my_select").innerHTML 
= "<option value='1'>not</option> 
<option value='2'>work</option>"; 

The correct way to insert options in a select is using appendChild or addOption functions. But that’s tiring if we are working with Ajax.

Use innerHTML is not the standard but it is very useful.

The function above, will help you to insert options like using innerHTML, in IE, Firefox or Opera.

Updated: now supports option-selected

Using my function:

var inner = 
"<option value='1'>Now</option> 
<option value='2'>work</option>"; 


select_innerHTML(document.getElementById("my_select"),inner);

The function. Add to your lib.

function select_innerHTML(objeto,innerHTML){

    objeto.innerHTML = ""
    var selTemp = document.createElement("micoxselect")
    var opt;
    selTemp.id="micoxselect1"
    document.body.appendChild(selTemp)
    selTemp = document.getElementById("micoxselect1")
    selTemp.style.display="none"
    if(innerHTML.toLowerCase().indexOf("<option")<0){
        innerHTML = "<option>" + innerHTML + "</option>"
    }
    innerHTML = innerHTML.toLowerCase().
replace(/<option/g,"<span").replace(/<\/option/g,"</span")
    selTemp.innerHTML = innerHTML
      
    
    for(var i=0;i<selTemp.childNodes.length;i++){
  var spantemp = selTemp.childNodes[i];
  
        if(spantemp.tagName){     
            opt = document.createElement("OPTION")
    
   if(document.all){ //IE
    objeto.add(opt)
   }else{
    objeto.appendChild(opt)
   }       
    
   //getting attributes
   for(var j=0; j<spantemp.attributes.length ; j++){
    var attrName = spantemp.attributes[j].nodeName;
    var attrVal = spantemp.attributes[j].nodeValue;
    if(attrVal){
     try{
      opt.setAttribute(attrName,attrVal);
opt.setAttributeNode(spantemp.attributes[j]
.cloneNode(true));


     }catch(e){}
    }
   }
   //getting styles
   if(spantemp.style){
    for(var y in spantemp.style){
     try{opt.style[y] = spantemp.style[y];}catch(e){}
    }
   }
   //value and text
   opt.value = spantemp.getAttribute("value")
   opt.text = spantemp.innerHTML
   //IE
   opt.selected = spantemp.getAttribute('selected');
   opt.className = spantemp.className;
  } 
 }    
 document.body.removeChild(selTemp)
 selTemp = null
}

Internet Browsing is one of the most common activates on computers nowadays and how many of us do spend most of the time searching for the features on menus? We have got a list of shortcuts which were used commonly among the users, which helps you save a lot of time. Learn them and have a faster browsing experience.

Navigation

  • Back – Backspace
  • Forward – Shift+Backspace
  • Home – Alt +Home
  • Open File – Ctrl+O
  • Reload – F5
  • Reload (override cache) – Ctrl+F5
  • Stop – Esc

Current Page

  • Go to Bottom of Page – End
  • Go to Top of Page    – Home
  • Move to Next Frame  –  F6
  • Move to Previous Frame  –  Shift+F6
  • Page Source    Ctrl+U
  • Print    Ctrl+P
  • Save Page As    Ctrl+S
  • Zoom In    Ctrl++
  • Zoom Out    Ctrl+-
  • Zoom Reset    Ctrl+0

Editing

  • Copy    Ctrl+C
  • Cut       Ctrl+X
  • Delete   Delete
  • Paste    Ctrl+V
  • Redo    Ctrl+YShift+Z
  • Select All    Ctrl+A
  • Undo    Ctrl+Z

Search

  • Find    Ctrl+F
  • Find Again    F3
  • Find As You Type Link    ”
  • Find As You Type Text    /
  • Find Previous    Shift+F3
  • Web Search    Ctrl+K

Windows & Tabs

  • Close Tab    Ctrl+F4
  • Close Window    Alt+F4
  • Move Tab Left (when tab is focused)    Ctrl+Left Arrow
  • Move Tab Right (when tab is focused)    Ctrl+Right Arrow
  • Move Tab to Beginning (when tab is focused)    Ctrl+Home
  • Move Tab to End (when tab is focused)    Ctrl+End
  • New Tab    Ctrl+T
  • New Window    Ctrl+N
  • Next Tab    Ctrl+Tab
  • Open Address in New Tab (from Location Bar or Search Bar)    Alt+Enter
  • Previous Tab    Ctrl+Shift+Tab
  • Undo Close Tab    Ctrl+Shift+T
  • Select Tab (1 to 8)    CtrlAltCmd+(1 to 8 )
  • Select Last Tab    Ctrl+Alt+9

Tools

  • Bookmark All Tabs    Ctrl+Shift+D
  • Bookmark This Page    Ctrl+D
  • Bookmarks    Ctrl+B
  • Library window    Ctrl+Shift+BO
  • Caret Browsing    F7
  • Downloads    Ctrl+J
  • History    Ctrl+H
  • Toggle Private Browsing    Ctrl+Shift+P
  • Clear Recent History    Ctrl+Shift+Del
  • Error Console    Ctrl+Shift+J

Miscellaneous

  • Complete .com Address    Ctrl+Enter
  • Complete .net Address    Shift+Enter
  • Complete .org Address    Ctrl+Shift+Enter
  • Delete Selected Auto-complete Entry    Shift+Del
  • Help    F1Cmd+?
  • Select Location Bar    Ctrl+L
  • Select or Manage Search Engines (when Search Bar is focused) F4

Firefox does not provide any method of customizing keyboard shortcuts. But they are all optimized for the best practices and user friendliness. Hope this can give a value addition to your internet browsing experience.

Google Chrome has been my default browser for quite some time, but I’ve got to admit… I like what I’m seeing so far in Firefox 4, and the tweaks just keep on coming. One recent addition which has been talked about for some time is the option to create App Tabs.

Firefox 4’s App Tabs look pretty much like a pinned tab in Google Chrome. For now, an App Tab appears to simply force a tab to the left and display it with the favicon only. It’s a great way to save additional space on your tab bar, and a feature I use religiously in Chrome.

Right now, you’ll only find App Tabs in the Mozilla nightly builds of Firefox 4 — which you can download here for Windows, Mac, and Linux. To create an App Tab, just right click and select the option from the context menu.