Question

How do I view my Code output in Notepad++ as a webpage or something similiar?

I have built something but I can't find a button or something like that in Notepad to view it as a webpage or something similiar.

Was it helpful?

Solution

If it is a webpage written in html: just go where you saved it and click it.

If it is in php:

You will need a web server, save the file in the www directory. and access it like this:

http://localhost/yourfile.php

OTHER TIPS

Simply, save your file with the correct extension in this case html, then click run , in the run menu click launch in, (in whichever is your browser) in my case, chrome.And it should work(:

Add this plugin in Notepad++: Preview HTML but it opens only in IE

To setup Notepad++ for testing your markup or code there are a few things to consider.

  1. When Notepad++ launches do you want a test document opened by default?
  2. What language do you prefer the document to be opened as?
  3. What browser do you wish to test your test file in?
  4. Do we want a shortcut to open test in browser?

If you do not have your local environment setup to run server-side scripts you will be limited to what the browser supports.

In my example setup I will be using .php as my language. There are some variables, but I've chosen what I believe best suit my needs. I'm also using a windows machine.

  • Create a new file in C:\Program Files (x86)\Notepad++ (or wherever) as php.php (or whatever). This will be the document we keep open and will remain open so long as we never close it.
  • In Notepad++ go to Settings > Preferences > New Document
  • In the bottom left there is a drop-down. Select your language (php in my case).
  • Open php.php in Notepad++.
  • Go to Run > Modify Shortcut / Delete Command and locate your desired browser (note: this may not work as expected in some browsers i.e. Internet Explorer, go figure).
  • Create a custom shortcut so your document can be launched to test (unless you are happy with what is already setup).

This will effectively keep your default file open in Notepad++ every time it is launched in your preferred language and allow you to quickly test your markup.

Cntrl + Alt + Shift + I(Alphabet if you want to open in Internet explorer)

I hope this will work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top