Advertisement
Guest User

Untitled

a guest
Aug 21st, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. app.get('/', function(req, res) {
  2. res.render('search.ejs', {
  3. json: myJsonString,
  4. links: links,
  5. titles: titles,
  6. domain: domain
  7. });
  8.  
  9. <script type="text/javascript">
  10. function codeAddress() {
  11. var data = <%- json %>;
  12. document.write('<ul>');
  13. for (var i = 0; i < data.length; i++) {
  14. document.write('<li><a href="">')
  15. document.write(data[i]);
  16. document.write('</li></a>')
  17. }
  18. document.write('</ul>');
  19. }
  20. codeAddress();
  21. </script>
  22.  
  23. $('ul li a').live('click', function() {
  24. console.log($(this).index());
  25. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement