• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

jQuery - Adding Image to DIV all Dynamic, Odd Behavior or Sleep Deprivation?

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Please ignore the fact that I am writing dialog junk that already exists. There's more to it than that. Each anchor element has an HREF attribute with a URL to an image. If I comment out the line where I modify the source of the image I create in the click handler (Line #7), the popup DIV shows up exactly right. However, leaving that line of code in, it forces the browser to navigate to the image src URL and I have no idea why.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've worked around the issue by doing this:



Still curious why the other code acts differently, however.

Well, something isn't wanting to render in my code. But I'm basically setting the src to the href of the anchor tag.
 
Sheriff
Posts: 67269
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is line 5 supposed to have a $?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Is line 5 supposed to have a $?



Sleep deprivation it is then. Thanks, Bear.
 
Bear Bibeault
Sheriff
Posts: 67269
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sometimes it just takes another set of eyes. What I call the "what's that semi-colon doing there?" syndrome*.








* Way back in the Ice Ages I was looking at a compilation problem for hours. My project leader walked by and in less than 2 seconds, saw the problem.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!