I want to open and append a javascript file (placed in Static folder)
from default.py file but not seem to get past the error:
filename = URL(r=request,c="static",f="jquery_dynamic.js")
try:
logfile = open(filename , 'w')
for each in restaurantsFeatures:
logfile.append('jQuery("span#thumbme%d"%each')
logfile.close()
msg = "The file exists"
except IOError:
msg = 'error
Why am I getting this error? Does this have anything to do with the
chmod issues?
IOError: [Errno 2] No such file or directory: '/Que_Hay_de_Comer/
static/jquery_dynamic.js'
2nd part of the question: I want to know if there is a better approach
in dynamically writing jQuery lines in web2py_ajax.html. Let's say,
I'm extracting a list of users wrapped in DIVs and with jQuery to
enable the user to hide or show the DIV. For example:
index.html
<div id="user1">user1<br><span id="user1">hide</span></div>
Now inside the document.ready jQuery function I would put:
web2py_ajax.html
jQuery("span#user1").click(function() {
jQuery("div#user1").hide()
});
So if I add more lines on list of index.html, I also to add lines for
jQuery to manipulate these same lines. At this moment, I'm <<include>>
a file to place these lines into the web2py_ajax.html. Is there a
better way to do this? Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---