I have several comments embedded in my website and I would like to be able to get the ID or the Jquery object refrence of the parent in which they are contained, for example, in the following code I would like to get the ID "container" just by locating the html comment as a string within the page[code]...
I have been working on this navigation for something to do, and I cannot for the life of me figure out how to get the parent category. Here is an example of my navigation:
Using 1.4.1. A comments app. Clicking certain links fetches a comment form which displays below. The button then becomes a "cancel" link. Clicking that removes the form and sets the button back to its original state. Or so it should. I'm seeing some strange behavior. Some strange, but understandable, some not so much.
After removing the form, my code fetches it again and re-displays it. The problem appears to be that click event isstill "happening" and so live() fires immediately. I tried using stopPropagation(), which keeps the form from re-loading but for some reason also keeps displayFormHandler from being run on subsequent clicks.
I saw a hint in the comments for stopPropagation() and added, in cancelFormHandler:
Again, this keeps the form from re-displaying but, bizarrely, causes displayFormHandler to always return false (the console.log() line runs every time). I can understand why the original problem happens but this doesn't make any sense at all. If the class has been removed, subsequent clicks should proceed normally because hasClass() is being evaluated at the time of the click, not when live() is called.
I am trying to create a conditional comment scenario that is based on a web address. I am working with an ecommerce site that I want to put a nav menu promotion on all the pages except the home page. The system we are using only allows a post promotion to ALL or one specified URL.
I have tried everything I can think of to create a URL condition based comment but nothing has worked. I tried modifying the code below to change the if output to a variable comment tag and then write the variable further in the script with a document.write.
var allowedChars = /^[a-zs]+$/i;
to specify that I only want characters and so on. Is there a way to reverse that to say this html input field CAN NOT contain any of the following? I want to check against a comment box to make sure no url address is entered (http:www.) because most spam contains urls in this field. Is there a simple solution?
I am really new to JS (literally just starting looking into it) and I was wondering if anybody could help me or give any suggestion as to how build a comment box which appear when a user click on the comment button.Now I had a stab at that but my JS skills are still really poor. Here's what I came up with after sometime looking around on the net and getting (or at least trying to) action some suggestions I managed to get here and there:
HTML Code: <html> <head> <style type="text/css">[code]......