you had not load the bootstrap.css, because you need to realize the static
file server. Then you get the js/bootstrap.min.js static file, server will
return the js file data!
在 2013年3月13日星期三UTC+8下午6时15分19秒,Timo Schmidt写道:
>
> Hi,
>
> i am quite new to node.js. I am trying to use bootstrap to node.js and
> tried the classic way. I simply wrote the "getting started code" of
> bootstrap to node.js just to try it. But when I'm trying to use simple
> rows/spans I get no good output. When I check it with firebug, I can see,
> that there would be no rule in the bootstrap.css (but there are).
>
> Node.js Code:
> function onRequest(req, res) {
> var postData = "";
> var pathname = url.parse(req.url).pathname;
> console.log("Request recieved");
>
> res.writeHead(200, {"Content-Type": "text/html"});
> res.write("<head>");
> res.write("<title>Bootstrap 101 Template</title>");
> res.write("<meta name='viewport' content='width=device-width,
> initital-scale=1.0'>");
> res.write("<link href='css/bootstrap.min.css' rel='stylesheet'
> media='screen'>");
> res.write("</head>");
>
> res.write("<body>");
> res.write("<div class='container'>");
> res.write("<div class='row show-grid'>");
> res.write("<div class='span4'>4</div>");
> res.write("<div class='span8'>8</div>");
> res.write("</div>");
> res.write("</div>");
> res.write("<script src='jquery/jquery'></script>");
> res.write("<script src='js/bootstrap.min.js'></script>");
> res.write("</body>");
> res.end();
>
> }
>
> http.createServer(onRequest).listen(8888);
> console.log('Server has started!');
>
>
> HTML Code:
> <html debug="true">
> <head>
> <title>Bootstrap 101 Template</title>
> <meta name="viewport" content="width=device-width, initital-scale=1.0"/>
> <link href="css/bootstrap.min.css" rel="stylesheet" media="screen"/>
> <style type="text/css"/>
> </head>
> <body>
> <div class="container">
> <script src="jquery/jquery"/>
> <script src="js/bootstrap.min.js"/>
> </body>
> <script src="
> chrome-extension://bmagokdooijbeehmkpknfglimnifench/googleChrome.js"/>
> </html>
>
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.