[jQuery] Still having problems with $(#myDiv').html('string').thoughts?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=656171417-05072006><FONT face=Arial color=#0000ff size=2>I'll
give that a shot Myles. I saw that method but wasn't sure how to implement it.
Thank you.</FONT></SPAN></DIV>
<P><FONT size=2><!----------------//------<BR>andy matthews<BR>web
developer<BR>certified advanced coldfusion programmer<BR>ICGLink,
Inc.<BR>andy@icglink.com<BR>615.370.1530
x737<BR>--------------//---------></FONT> </P>
<BLOCKQUOTE>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> discuss-bounces@jquery.com
[mailto:discuss-bounces@jquery.com]<B>On Behalf Of </B>Myles
Angell<BR><B>Sent:</B> Wednesday, July 05, 2006 12:07 PM<BR><B>To:</B> jQuery
Discussion.<BR><B>Subject:</B> Re: [jQuery] Still having problems with
$(#myDiv').html('string').thoughts?<BR><BR></FONT></DIV><SPAN
class=gmail_quote></SPAN>On this page (<A
href="http://commadelimited.com/recipes/">http://commadelimited.com/recipes/</A>),
I've got a div with an id<BR>
<DIV>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">of
"title". At the bottom of the page I'm running this
function:<BR><BR>function updateTitle(str)
{<BR> $('#title').html(str);<BR>}<BR><BR>like
so:<BR><script language="JavaScript"><BR><!--
<BR> updateTitle('Welcome to
recipe Manager');<BR>//--><BR></script><BR><BR>But I get an
error<BR>Error: $("#title") has no properties<BR>Source File: <A
href="http://localhost/personal/commadelimited/recipes/includes/js.js">http://localhost/personal/commadelimited/recipes/includes/js.js</A></BLOCKQUOTE>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">Can
someone shed some light on this please? <BR></BLOCKQUOTE></DIV><BR>You're
firing off the call to a jQuery object before the .ready event.<BR><BR>if you
instead... move the script to the top of your document, and do it as
such:<BR><BR>$(document).ready(function(){
<BR> updateTitle('Welcome to recipe
Manager');<BR>});<BR><BR><BR>It's untested, but I betting that not using the
.ready function is causing most of your
headache.<BR><BR>Myles<BR></BLOCKQUOTE></BODY></HTML>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/