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.
<SCRIPT LANGUAGE="JavaScript">
<!--
url=location.href
if (url=="http://www.sitename.com") {alert("Welcome To sitename")}
else {alert("welcome")};
// -->
In javascript, I want to do run a script based on the contents of a page. My page called page.php either contains only a 1 or is totally blank, and I want, from another page, to query the contents of that page in the form of an if, then, else statement. Code:
I am trying to set a link on our Intranet server to another onsite system.
I want to send people to a page, that performs a check to see if the website on the other server is ONLINE. If not then display a message along the lines of SORRY PLEASE TRY LATER.
I have done some searching and it seems that I might be able to use the onerror part within javascript.
I am starting to learn javascript and I had a quick question. I know actionscript and java, so this my mistake here is probably context...but I cant seem to figure it out. I'm trying to figure out how to create a conditional statement based on what button a user clicks. Here's my code:
[Code]....
This doesn't seem to work. Am I referencing this.value incorrectly? If so, what's the proper way to get information about what the user clicked?
There's a number of javascripts available on the web to take the rss feed of a blog and display it on a website. Does anyone know of any that also provide link to add comments that will display with the feed?
I came across some embedded JavaScript code and I noticed some weird “HTML comment-like tags” within embedded JavaScript that are getting rendered in FireFox but not IE. Specifically the closing tag "//--> And the JavaScript code between these tags is functional (not commented out)!
I have a form with a javascript form validator to check against all fields to make sure they are entered in correctly and to reduce spam. I am using Code:
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?
this website vertical-scroller.vbarsan dot com/ . In the left middle of screen. You will be seeing scrolling comments. Can anyone tell me how to do it?
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]......
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'm trying to make a comment field that only appears once you've clicked the "Add comment link". I'd like it to replace the add comment link. I assume this is an onclick event of some sort, but I'm not sure quite how to go about doing it.
I have this loop I run to retrieve wallposts with php. Within this loop, I want a link/button on every post that says "comment". When the user clicks the comment link I want a comment field and post button to appear on the post I clicked on. The problem is that when I've tried making a link that does this, it only drops down the comment field on the most recent wallpost regardless of which wallpost I click on.
I have not been able to do any JS because my damn books have been on order for the last 3 weeks put a script into my webpage so that when anybody visits the 'contact us' page they can leave comments.
Here's my code:
HTML:
<!DOCTYPE html "PUBLIC-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>
[Code].....
I know this doesn't validate but it's only a draft site until I get my books.
Here's the page, I want the comment underneath all three div's.
It checks that the character before the comment isn't a backslash or that we're at the start of a string/line since it's in multi-line mode. Then it captures the actual comment. Seems to work so far... I have the following RegEx that matches double slash comments:
Code JavaScript: ///.*$/gm
It works fine except for this one exceptional case where a RegEx which ends in a slash is followed by a comment as in the following example:
Code JavaScript: //*[sS]*?*//gm, // Slash comment
The RegEx captures "//gm // Slash Comment" as a comment, removes that piece, and in the process breaks what used to be a valid RegEx statement. how I might be able to fix the pattern to avoid this issue?
I want to find any <!-- --> comment tags in a page and then read the contents. I would also like to distinguish between those in the body and those elsewhere in the HTML document.What do I use to get an array of these elements?
I have a drop down selection box with several selections and if a person selects "other" from that box I want to show a comment box so they can fill in their comments. Otherwise the comment box will remain hidden.
I know that we can combine 2 pages into one, but i dont know what exact terms it called or say open and hide?
I have 2 pages, view.php and comment.php. inside view.php there will be a link to open comment.php. instead of doin this, i want to put the codes in one page call comment.php. i'm quiet sure that it using javascript, using id, onclick and sometimes called frames(not sure...) ?? but i dont know how to implement it. So can someone gimme any reference that i can refer to? example and solution aso can so i can get an idea on it.
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.
Basic code:
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:
And:
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.
Is there anybody who knows were to find a javascript that does the trick of conditional pulldowns (3).
Here is what i am looking for: When you select an item from the first pulldown, the second pulldown gets populated with the children of the item you choose. Then, when you select an item from the newly populated second pulldown, the third puldown gets populated.