我是javascript的新手并尝试将一个txt文件打开到var然后将其注入html div ...我尝试使用fopen但我没有成功.
<script type="text/javascript">
file = fopen(getScriptPath("info.txt"), 0);
file_length = flength(file);
var content = fread(file,file_length);
var div = document.getElementById("myDiv");
//alert(div);
div.innerHTML = "";
div.innerHTML = content;
</script>
Run Code Online (Sandbox Code Playgroud) 我是新手触摸并尝试使用sass和指南针..我安装了所有内容并设置了一切但是在尝试编译application.scss文件时我得到以下消息:
{:cache_location=>"/Users/EladG/Sites/Pt4u/resources/scss/.sass-cache", :sass=>
{:cache_location=>"/Users/EladG/Sites/Pt4u/resources/scss/.sass-cache", :cache=>true,
:line_comments=>false, :style=>:compressed, :load_paths=>
[#<Sass::Importers::Filesystem:0x10a58e548 @root="/Users/EladG/Sites/Pt4u/resources/scss">,
#<Sass::Importers::Filesystem:0x10a58e520 @root="/Library/Ruby/Gems/1.8/gems/compass-0.12.alpha.4
/frameworks/blueprint/stylesheets">, #<Sass::Importers::Filesystem:0x10a58e430 @root="/Library
/Ruby/Gems/1.8/gems/compass-0.12.alpha.4/frameworks/compass/stylesheets">,
Compass::SpriteImporter]}, :sass_files=>nil}
***error application.scss (Line 5: File to import not found or unreadable: sencha-touch/default/all.***
Load paths:
/Users/EladG/Sites/Pt4u/resources/scss
/Library/Ruby/Gems/1.8/gems/compass-0.12.alpha.4/frameworks/blueprint/stylesheets
/Library/Ruby/Gems/1.8/gems/compass-0.12.alpha.4/frameworks/compass/stylesheets
Compass::SpriteImporter)
Sass::SyntaxError on line 5 of /Users/EladG/Sites/Pt4u/resources/scss/application.scss: File to
import not found or unreadable: sencha-touch/default/all.
Load paths:
/Users/EladG/Sites/Pt4u/resources/scss
/Library/Ruby/Gems/1.8/gems/compass-0.12.alpha.4/frameworks/blueprint/stylesheets
/Library/Ruby/Gems/1.8/gems/compass-0.12.alpha.4/frameworks/compass/stylesheets
Compass::SpriteImporter
Run with --trace to see the full backtrace
Run Code Online (Sandbox Code Playgroud)
ruby文件:
# Delineate the directory for our SASS/SCSS files (this directory)
sass_path = File.dirname(__FILE__)
# Delineate …Run Code Online (Sandbox Code Playgroud)