1

I'm building an example of Angular Views in jsBin that's not acting how I would expect. I know in jsBin you can request just the JavaScript from a bin when there is no html by appending js to the address of the bin.
e.g.
http://jsbin.com/ACUFuCa/1/js //works for JavaScript

So far this does not seem to be the case with HTML. Is there a way to have jsBin return just the markup I have in the HTML section with out it wrapping it or injecting any other parts of the document (css, JavaScript)? When I view the source of a bin that has just html I see that there are still script tags being added.

I have tried the raw url:
http://jsbin.com/ONUdenU/1
Using the same syntax as would be used for JavaScript:
http://jsbin.com/ONUdenU/1/html
Then finally a whim of:
http://jsbin.com/ONUdenU/1/?html

The demo I was trying to build and use jsBin as the source of the templates... http://jsbin.com/oVUbeHI/4/edit

QueueHammer
  • 10,515
  • 12
  • 67
  • 91

2 Answers2

1

There's no currently any way to get just the html alone in jsbin. I wasn't sure there was ever a use case...as .html contains script tags and jsbin does the combining for you.

If I follow you correctly, you're trying to get just the HTML so you can use it as a template (in another example), is that right?

If that's the case, the way that you can do this is by creating a second bin that just contains HTML templates.

Remy Sharp
  • 4,520
  • 3
  • 23
  • 40
  • This is something I tried. The script code to append the "edit in jsBin" is being added to what is returned. Updated the question to be more complete. Kind of an honor to have you answer my question :) – QueueHammer Sep 03 '13 at 05:25
  • I had the same need, but I didn't want the extra javascript that jsbin is tacking into the HTML panel, so for Angular, at least, I was able to put HTML into a CSS bin, and that worked just fine since jsBin is more than happy to serve the CSS in an unadulterated form (and angular ignores the content-type headers for templates). – Tony K. Dec 06 '13 at 21:50
1

I'm trying to do something similar with jQuery Mobile pages. Tony K's trick of putting the HTML in the CSS section, and then using jsbin.com/<bin>/<rev>.css worked like a charm!

Dan
  • 1,313
  • 1
  • 14
  • 21