• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Bear Bibeault
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Jj Roberts

Hyperlink on the Fly

 
Ranch Hand
Posts: 2051
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to know how to create a HyperLink to appear on the current page with JavaScript based on a result from a ajax process.
 
Marshal
Posts: 67478
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What code do you have so far?
 
Steve Dyke
Ranch Hand
Posts: 2051
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The line "THIS IS WHERE I AM STUCK" is my question. Every thing else works great.

 
Bear Bibeault
Marshal
Posts: 67478
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you could either use innerHTML if you want to build HTML markup in strings, or DOM manipulation if you'd rather use an API. Are you famniliar with either of these?
 
Steve Dyke
Ranch Hand
Posts: 2051
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am familar with the DOM but I do not know the syntax for adding a href tag.
 
Bear Bibeault
Marshal
Posts: 67478
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's the same as adding any other element.

What types of elements have you added using DOM methods before?
 
Can you shoot lasers out of your eyes? Don't look at this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic