简体   繁体   English

括号 - 实时预览不起作用

[英]Brackets - Live Preview not working

I found this awesome program(html editor) called Brackets and it's by Adobe.我发现了一个很棒的程序(html 编辑器),叫做 Brackets,它是由 Adob​​e 开发的。 Now reason why i got the editor was because i wanted to Live Preview PHP code, but i found out later that i needed a Wamp Server.现在我得到编辑器的原因是因为我想实时预览 PHP 代码,但后来我发现我需要一个 Wamp 服务器。

Now, i was in the mood of making an about page but i couldn't live preview.现在,我想制作一个关于页面,但我无法实时预览。 Live Preview Base URL is empty, and when i try to live preview, i get this: > http://puu.sh/aDkET/4209ec1192.png < and the lightning bolt is half orange(i heard it needs to be red to work).实时预览基本 URL 为空,当我尝试实时预览时,我得到这个:> http://puu.sh/aDkET/4209ec1192.png < 并且闪电是半橙色(我听说它需要是红色才能工作)。 I have tried the lot... Entering as Live Preview Base URL to http(semicolon)//localhost:(insertporthere)/ <-- Wamp Server, tried only localhost, left it empty, I don't know how to make this work.. I am stuck and i basically need real preview..我已经尝试了很多...作为实时预览基本 URL 输入到 http(semicolon)//localhost:(insertporthere)/ <-- Wamp Server,只尝试了 localhost,将其留空,我不知道如何制作工作..我被卡住了,我基本上需要真正的预览..

Please, please help me!拜托,请帮帮我! D: I have searched the internet looking for solutions, but no. D:我在互联网上搜索过解决方案,但没有。 If you can, a step-by-step tutorial would be much appreciated :)如果可以,将非常感谢分步教程:)

Kind regards, - PiguFilms亲切的问候, - PiguFilms

The Live Preview "Base URL" is the localhost URL that corresponds to the root folder of your project.实时预览“基本 URL”是对应于项目根文件夹的本地主机 URL。 Brackets uses this to map from a local path on disk to the server URL which serves up that same file: it takes the HTML file's path relative to the project root, appends that relative path onto the Base URL, and then launches the resulting full URL in Chrome. Brackets 使用它从磁盘上的本地路径映射到提供相同文件的服务器 URL:它获取 HTML 文件相对于项目根目录的路径,将该相对路径附加到基本 URL,然后启动生成的完整 URL在铬。

So, for example:因此,例如:

  • If your page is at http://localhost/myapp/page.php and the page.php file is in a "myapp" subfolder of your project, your base URL is just http://localhost/ .如果您的页面位于http://localhost/myapp/page.php并且 page.php 文件位于项目的“myapp”子文件夹中,则您的基本 URL 就是http://localhost/
  • If your page is at http://localhost/myapp/page.php and the page.php file is in the root of your project, your base URL is http://localhost/myapp/ (this way the path is "/page.php" relative to both bases).如果您的页面位于http://localhost/myapp/page.php并且 page.php 文件位于项目的根目录中,则您的基本 URL 为http://localhost/myapp/ (这样路径为“/ page.php”相对于两个基地)。

If you think you have the Base URL set correctly but it's still not working, try going to the same URL manually in your browser to make sure your server is operating correctly.如果您认为基本 URL 设置正确,但仍然无法正常工作,请尝试在浏览器中手动访问相同的 URL,以确保您的服务器正常运行。

More details on using Live Preview with your own local server can be found here: https://github.com/adobe/brackets/wiki/How-to-Use-Brackets#lp-custom-server .有关在您自己的本地服务器上使用实时预览的更多详细信息,请访问: https : //github.com/adobe/brackets/wiki/How-to-Use-Brackets#lp-custom-server

although @ytpete's answer is the right choice for your problem but you need to do, as i say, first.尽管@ytpete 的答案是解决您问题的正确选择,但正如我所说,您首先需要做的是。 In simple words, go to file(in Brackets), click open folder and now make the project directory exactly same as your local host server for php files ie C:\\Program Files\\Ampps\\www\\phpFiles (i am using Ampps and here 'phpFiles' is a subfolder inside which relies my php file and also html file too).简单来说,转到文件(在括号中),单击打开文件夹,现在使项目目录与 php 文件的本地主机服务器完全相同,即 C:\\Program Files\\Ampps\\www\\phpFiles(我正在使用 Ampps 和这里'phpFiles' 是其中的一个子文件夹,它依赖于我的 php 文件和 html 文件)。 Now you can follow steps shown by ytpete and you are set to live preview of your php file.现在您可以按照 ytpete 显示的步骤进行操作,并设置为实时预览您的 php 文件。

如果您使用的是 Windows,请尝试运行方括号“以管理员身份”,这对我有用

I had this problem as well.我也有这个问题。 What I did was simply goto File->Open Folder... it all worked after all the necessary files were loaded into Brackets.我所做的只是转到“文件”->“打开文件夹”……在将所有必要的文件加载到 Brackets 后,一切都奏效了。

I had this same issue once I installed Xampp.安装 Xampp 后,我遇到了同样的问题。 This video resolved it for me.这个视频为我解决了这个问题。 Essentially just select, File > 'Enable Experimental Live Preview' should have a check mark.基本上只需选择,文件 > '启用实验性实时预览'应该有一个复选标记。

确保在使用 Brackets 的实时预览时没有运行 Internet 带宽限制器(例如 NetLimiter)。

I have just fixed this issue for myself, I had 'Experimental Live Preview' ticked under file.我刚刚为自己解决了这个问题,我在文件下勾选了“实验性实时预览”。 I unticked it and now it accepts my ' http://localhost/mywebsite ' URL when I go to live preview.我取消勾选它,现在当我去实时预览时它接受我的“ http://localhost/mywebsite ” URL。

This worked for me.这对我有用。 I restarted my system and then unchecked "enable experimental live preview" in file.我重新启动了系统,然后在文件中取消选中“启用实验性实时预览”。

this worked for me, and i don't remember where i saw it, but go to : cd $HOME/.local/share/applications and delete everything chrome related.这对我有用,我不记得我在哪里看到的,但是请转到: cd $HOME/.local/share/applications并删除与 chrome 相关的所有内容。

This worked for me, and i didn't dare to use live preview again.这对我有用,我不敢再次使用实时预览。

On Ubuntu 16.04 LTS and Chrome Version 61.0.3163.100 (Official Build) (64-bit)在 Ubuntu 16.04 LTS 和 Chrome 版本 61.0.3163.100(官方版本)(64 位)上

将您的文件放在您拥有 index.html 文件的同一文件夹中

I have selected the option called "reload with extension" from Bracket's debug menu and that resolved live preview issue.我从 Bracket 的调试菜单中选择了名为“使用扩展重新加载”的选项,并解决了实时预览问题。 More details can be found here .可以在此处找到更多详细信息。

For everyone, this problem can be resolved by following steps:-对于每个人来说,这个问题可以通过以下步骤来解决:-

  1. On menu bar, go to File --> Open Folder (folder which have your html file for live preview)在菜单栏上,转到文件 --> 打开文件夹(包含用于实时预览的 html 文件的文件夹)

  2. Select Folder选择文件夹

  3. Select your html file from left side bar for live preview从左侧栏中选择您的 html 文件进行实时预览

  4. Click on bolt icon on right (preview button)单击右侧的螺栓图标(预览按钮)

All it melts down to the fact, that you need that folder(which have your file) selected to view your output in live preview.所有这一切都归结为一个事实,即您需要选择该文件夹(其中包含您的文件)以在实时预览中查看您的输出。 Let me know, if it helps someone.如果对某人有帮助,请告诉我。 :) :)

It is because it doesn't find the 'html' file.这是因为它没有找到“html”文件。 Live preview basically needs html file to run it .In my case, I have a project made in php , my file name is index.php ,I renamed it to index.html and it works like charm :)实时预览基本上需要 html 文件来运行它。就我而言,我有一个用 php 制作的项目,我的文件名是index.php ,我将它重命名为index.html ,它的工作原理就像魅力:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM