JavaScript - Dojo: Dijit Users, I Can't Find A File
I have recentley decided to move from prototype to DOJO. I have the latest 1.3.2 and i am having problems accessing the themepage.html
They tell you in their documents that you can install it on the server, place the files on the server or install it locally. So i installed it in my files on site. They tell you to go to: "http://your-webpage.com/js/dojo-1.3.2/dijit/themes/themeTester.html" when looking locally through my files their isn't a page like that. What page should i look at to view the widgets? Thank you for any help. Similar TutorialsHi all. I'm experiencing an issue with dijit.Tree/ForestStoreModel/ItemFileWriteStore and I just can't seem to figure out what's going on. If I start with an empty store model ... var myData= { "identifier" : "id", "label" : "name", "items" : [] }; var myStore = new dojo.data.ItemFileWriteStore({ data: myData }); var myModel = new dijit.tree.ForestStoreModel({ sto masterStore, query: {type: 'task'}, rootId: "tasks_id", rootLabel : "Tasks", childrenAttrs: ["children"] }); If I eventually execute newItem on the store, the tree is not updated. myStore.newItem( { id: "2", name : "someName2", type : 'task', children : [], } ); However, if during declaration of my data, I include 1 item, ie. var myData= { "identifier" : "id", "label" : "name", "items" : [ {"id" : "1", "name" : "someName", "type" : "task"} ] }; Then I can subsequent call newItem as many times as I wish, and the tree is updated correctly. If anybody has any ideas, I'm all eyes. In my latest project I have integrated dojo.There I have have a Dnd functionality in which I have to drag a dndItem into a textarea. For this I have converted the textarea to a dojoDnd Target with the dojoType attribute. Now the problem is the target textarea accepts dnd items only in explorer , opera and chrome.But this doesn't works in mozilla.Since my application runs only in mozilla I cannot proceed any more till I get out of this problem. Can you help me out of this? hi anyone know how to style the dojo button cause i declare the button it appear but i cannot use the style:"border:0px; background-color: black;" this is how i declare my dojo button var forward = new dijit.form.Button({ style: "border:0px;background:black;", label: "NEXT" }); Please help me with this !!! Please Reply ASAP!!! Thanks p.s if can show me some sample hey another know how can i change the background color of the title bar in the dojo dialog box? cause i search and i couldn't find any way.... Please help me and reply asap Thanks p.s if can show me sample code of how to change I am doing a project and I have a problem. I have retrieved data from a json file using ajax and the xmlhttprequest, but I am not able to put the content I retrieve into the dojo content pane. The content pane is inside a border container. I have tried the following, but it does not work. The HTMLPage4.html has the json data inside. please help me really urgent to me!!!!!!!as soon as possible Code: function getInfoContent(graphic) { function ajaxRequests() { var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE if (window.ActiveXObject) { //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken) for (var i = 0; i < activexmodes.length; i++) { try { return new ActiveXObject(activexmodes[i]) } catch (e) { //suppress error } } } else if (window.XMLHttpRequest) // if Mozilla, Safari etc return new XMLHttpRequest() else return false } var mygetrequests = new ajaxRequests() mygetrequests.onreadystatechange = function() { if (mygetrequests.readyState == 4) { if (mygetrequests.status == 200 || window.location.href.indexOf("http") == -1) { var bookss = eval("(" + mygetrequests.responseText + ")") //retrieve result as an JavaScript object var rssent = bookss.infos.info for (var i = 0; i < rssent.length; i++) { // alert(mygetrequests.responseText); var placeImg = "" var txt = "" // placeImg += rssent[i].descImg txt += rssent[i].desc var shorttxt = "" shorttxt += txt.substring(0, 30); var bc = new dijit.layout.BorderContainer({ style: "font-size: 11pt; height: 574px; width:739px; border:0px;" }); var c1 = new dijit.layout.ContentPane({ region: "top", style: "height: 11.5%; width: 100%; color: black; background-color: transparent; border:0px;", content: "<table><div id = \"mydiv\">" + shorttxt + "<font color = '#0000FF' size = '1'><a onclick='showmore();'><u> More...</u></a></div></td></table>" }); bc.addChild(c1); } } else { alert("An error has occured making the request") } } return bc.domNode; } mygetrequests.open("GET", "HTMLPage4.htm", true) mygetrequests.send(null) } hii i am doing a project and i meet some problem i create a dojo dialog box i need to style the dialog box into whole thing white but i am not able to style the border (the grey line) between the title and content so i was wondering how am i goin to style it into white? i don't use the css to style it so i was wondering how to write it like " noteDlg.titleBar.style.background = 'white'; " this kind to remove the grey line between the title and content thanks ps. I really need it very urgently...hope reply asap function note(){ noteDlg = new dijit.Dialog({ title: "Programatic Dialog Creation", draggable: false, style: "width: 300px; border:0px; " }); // set the content of the dialog: noteDlg.attr("content", "Hey, I wasn't there before, I was added at "); noteDlg.titleBar.style.background = 'white'; noteDlg.show(); } Does someone know what the JavaScript for checking if an user have "liked" and "shared" on Facebook? As far as I know, you can not check if they've shared, but only if they've clicked the button. I don't know if you can make them like to view, but it would be nice to get that piece of code too, if obtainable. I'm going to use it for a website where you have to "like" a fb page shown, and have to share the website. If someone can provide it, I'd also like a guide on timers /foldager Either that or provide me with an alternative way of coding a web application in a browser. Suppose I create a nifty web application that runs in your browser for which there is currently high market demand, but for some reason competitors have all overlooked it. I am sure that if I simply implemented it in regular JavaScript for all to see, it would not be long before competitors catch on and steal the concept from me (loosely speaking, in a way that doesn't violate copyright). However, I can delay my competitors if I can find a way to conceal the code. But JavaScript is not readily concealable, and there are always simple ways to reveal it by common methods suggested by people. Is anybody clever enough to suggest a solution for me? Hi, I'm just wondering if I can do a check on my page to determine if users have javascript enabled, and if not, redirect them to a different webpage. My site requires javascript, and without it, all the jquery popup boxes and stuff overlap, so I'd rather the user just not see any of that at all. I was wondering, could you have more than one username and password for the Username and Password II script? and if so, could you tell me how?
I wish to have a user list updated every 20 seconds or so with the users that are still online. I have the time(); stored in the database with their usernames, how do i get this uaing JavaScript. I have a program written in Javascript (saved as an HTML file that I run from my desktop by launching it in IE) which works fine on my system. Running IE 8 in Vista on one system and XP on another. When I launch the file, I get warning in the information bar: "To help protect your security, Internet Explorer has restricted this webpage from running scripts or ActiveX cntrols that could access your computer. Click here for optons..." I actually WANT this warning. When I click through it to accept, the program works fine. But about half of the people that I share this program with are not getting this warning, and it appears that the javascript never runs. At first I thought it was something in Windows 7, because two of the users were running on that OS, and I've found a number of issues described online about having problems running scripts in IE8/Win7. But the latest user is also running Vista, like me. His security settings are set to the default, Medium-High. But he's still not getting the script/ActiveX warning in the message bar. Anyone know how we can enable that warning? Thanks! Perhaps this wouldn't even be Javascript, but here's my question. Is there a script that would direct Opera users past the front page of a web site (that uses flash) to the home page? For instance, a site I'm building as a favor to a church has a flash intro page that is fine with every browser but Opera. (Opera doesn't respond to Autoplay but places a large "Play" button where the flash is located.) On this particular page, the flash movie ends with an "Enter" instruction and is a hyperlink to the "home" page, so if an Opera user clicks that button, they're still not going to see the flash but are going to arrive at the "home" page. Is there a way to not even present them with the flash page, but to send them straight to the home page? I'd appreciate any assistance. Hi everyone, first time on these forums. I've installed a WordPress plugin that displays which users are currently online, as a widget on the side-panel of my website, www.mi6gaming.com . There's some problems, however. When using the default code, all the members display correctly and load quickly, but there's no limit to the ammount of users displayed, so it goes on for about 30 members, and then it just starts to overlap and it looks ridiculous. Here is the download link to view any of the files: http://wordpress.org/extend/plugins/...-online/stats/ See screenshot of what i'm talking about: http://i.imgur.com/JYPGQ.png When I change "0" to a certain number, say 5, what that does is it will constantly display 5 members at any given time, and any other members who are currently online will be displayed on top of that. So say I'm a visitor to the website, I will see the 5 most recent people online, and if anyone else logs on during that time, it will display them as being online on top of the other 5 most recently online people. But, this isn't working correctly. It only shows, for some reason, a specific 5 people all the time and does not update whenever somebody else is logged in. So anytime you visit the website, it always shows the same 5 people and the last time they were logged in, even if other people were logged in more recently than them. See screenshot: http://i.imgur.com/CBE53.png So; when I have the code set at 0, it displays everyone correctly and updates on time, but it doesn't cap off and it's too long and overlaps. When I have it set at 5, it stays fixated on 5 people all the time and updates the times THEY were last online, and it shows who is online at the present time, but you have to be on the same page for 45 seconds to be able to see "who's online" right then, whereas when it's at 0, everything is instant and flawless, except for not stopping. Is there any way to add code to prevent it from loading X ammount of users, and to limit it to a certain number? That would likely be the simplest answer. Here is the code: .css Code: .wpwhosonline-row { float: none; width: auto; height: 33px; padding-bottom: 10px; padding-top: 5px; } .wpwhosonline-row > img { float: left; margin-right: 1ex; } .wpwhosonline-active > span { font-weight: bold; color: green; } .wpwhosonline-recent > span { } .wpwhosonline-ancient > span { font-style: italic; color: red; } /* kubrick style follows */ #sidebar ul li.widget_wpwhosonline ul li:before { content: none; } .php Code: <?php /* Plugin Name: Who's Online Plugin URI: http://www.plymouth.edu/ Description: Sidebar widget to log when a user was last online Version: 0.5.1 Author: Adam Backstrom Author URI: http://blogs.bwerp.net/ License: GPL2 */ /* Copyright 2011 Adam Backstrom <adam@sixohthree.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ function wpwhosonline_enqueue() { add_action( 'wp_head', 'wpwhosonline_pageoptions_js', 20 ); wp_enqueue_script( 'wpwhosonline', plugins_url('wp-whos-online.js', __FILE__), array('jquery'), 1 ); wp_enqueue_style( 'wpwhosonline_css', plugins_url('wp-whos-online.css', __FILE__), null, 1 ); } add_action('wp_enqueue_scripts', 'wpwhosonline_enqueue'); // our own ajax call add_action( 'wp_ajax_wpwhosonline_ajax_update', 'wpwhosonline_ajax_update' ); // hook into p2 ajax calls, if they're there add_action( 'wp_ajax_prologue_latest_posts', 'wpwhosonline_update' ); add_action( 'wp_ajax_prologue_latest_comments', 'wpwhosonline_update' ); /** * Update a user's "last online" timestamp. */ function wpwhosonline_update() { if( !is_user_logged_in() ) return null; global $user_ID; update_user_meta( $user_ID, 'wpwhosonline_timestamp', time() ); }//end wpwhosonline_update add_action('template_redirect', 'wpwhosonline_update'); /** * Echo json listing all authors who have had their "last online" timestamp updated * since the client's last update. */ function wpwhosonline_ajax_update() { global $wpdb; // update timestamp of user who is checking wpwhosonline_update(); $load_time = strtotime($_GET['load_time'] . ' GMT'); $users = wpwhosonline_recents( "meta_value=$load_time" ); if( count($users) == 0 ) { die( '0' ); } $now = time(); $latest = 0; $return = array(); foreach($users as $user) { $row = array(); $last_online_ts = get_user_meta( $user->ID, 'wpwhosonline_timestamp', true ); if( $last_online_ts > $latest ) $latest = $last_online_ts; $row['user_id'] = $user->ID; $row['html'] = wpwhosonline_user( $last_online_ts, $user ); $row['timestamp'] = $last_online_ts; $return[] = $row; } echo json_encode( array('users' => $return, 'latestupdate' => gmdate('Y-m-d H:i:s', $latest)) ); exit; } function wpwhosonline_pageoptions_js() { global $page_options; ?><script type='text/javascript'> // <![CDATA[ var wpwhosonline = { 'ajaxUrl': "<?php echo esc_js( admin_url('admin-ajax.php') ); ?>", 'wpwhosonlineLoadTime': "<?php echo gmdate( 'Y-m-d H:i:s' ); ?>", 'getwpwhosonlineUpdate': '0', 'isFirstFrontPage': "<?php echo is_home(); ?>" }; // ]]> </script><?php } function wpwhosonline_usersort( $a, $b ) { $ts_a = get_user_meta( $a->ID, 'wpwhosonline_timestamp', true ); $ts_b = get_user_meta( $b->ID, 'wpwhosonline_timestamp', true ); if( $ts_a == $ts_b ) { return 0; } return ($ts_a < $ts_b) ? 1 : -1; } function wpwhosonline_recents( $args = array() ) { $args = wp_parse_args( $args, array( 'meta_key' => 'wpwhosonline_timestamp', 'orderby' => 'wpwhosonline_timestamp', 'order' => 'DESC', 'meta_value' => time() - 604800, // 1 week 'meta_compare' => '>', 'count_total' => false, 'number' => 0 )); $users = get_users( $args ); foreach( $users as $user ) { // grab all these values, or you'll anger usort by modifying // an array mid-execution. get_user_meta( $user->ID, 'wpwhosonline_timestamp', true ); } usort( $users, 'wpwhosonline_usersort' ); return $users; } function wpwhosonline_list_authors() { $users = wpwhosonline_recents(); $html = '<ul class="wpwhosonline-list">'; foreach( $users as $user ) { $last_online_ts = get_user_meta( $user->ID, 'wpwhosonline_timestamp', true ); $item = wpwhosonline_user( $last_online_ts, $user ); $class = wpwhosonline_class( $last_online_ts ); $item = '<li id="wpwhosonline-' . $user->ID . '" class="wpwhosonline-row ' . $class . '" data-wpwhosonline="' . esc_attr( $last_online_ts ) . '">' . $item . '</li>'; $html .= $item; } $html .= '</ul>'; echo $html; } function wpwhosonline_user( $last_online_ts, $user ) { $avatar = get_avatar( $user->user_email, 32 ); $name = $user->display_name; $link = '<a href="' . get_author_posts_url( $user->ID, $user->user_nicename ) . '" title="' . esc_attr( sprintf(__("Posts by %s"), $user->display_name) ) . '">' . $name . '</a>'; // this should always exist; we queried using this meta if( ! $last_online_ts ) { continue; } $now = time(); if( $now - $last_online_ts < 120 ) { $last_online = 'Online now!'; } else { $last_online = human_time_diff( $now, $last_online_ts ) . ' ago'; } $last_online_title = date_i18n( get_option('date_format') . ' ' . get_option('time_format'), $last_online_ts ); if( $last_online ) { $last_online = '<span title="Last online: ' . esc_attr( $last_online_title ) . '">' . $last_online . '</a>'; } return $avatar . $link . '<br>' . $last_online; } function wpwhosonline_class( $lastonline ) { $diff = time() - $lastonline; if( $diff > 7200 ) { return 'wpwhosonline-ancient'; } elseif( $diff > 600 ) { return 'wpwhosonline-recent'; } else { return 'wpwhosonline-active'; } } function widget_wpwhosonline_init() { // Check for the required plugin functions. This will prevent fatal // errors occurring when you deactivate the dynamic-sidebar plugin. if ( !function_exists('wp_register_sidebar_widget') ) return; // This is the function that outputs the Authors code. function widget_wpwhosonline($args) { extract($args); echo $before_widget . $before_title . "Users" . $after_title; ?> <ul> <?php wpwhosonline_list_authors(); ?> </ul> <?php echo $after_widget; } // This registers our widget so it appears with the other available // widgets and can be dragged and dropped into any active sidebars. wp_register_sidebar_widget( 'widget_wpwhosonline', "Who's Online", 'widget_wpwhosonline' ); } // Run our code later in case this loads prior to any required plugins. add_action('plugins_loaded', 'widget_wpwhosonline_init'); .js Code: /* Copyright (C) 2011 Adam Backstrom <adam@sixohthree.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ jQuery(function($) { /* * Update author "last online" timestamps */ function getwpwhosonline(){ toggleUpdates(); var queryString = wpwhosonline.ajaxUrl +'?action=wpwhosonline_ajax_update&load_time=' + wpwhosonline.wpwhosonlineLoadTime + '&frontpage=' + wpwhosonline.isFirstFrontPage; ajaxCheckAuthors = $.getJSON(queryString, function(response){ if(typeof response.latestupdate != 'undefined') { wpwhosonline.wpwhosonlineLoadTime = response.latestupdate; for(var i = 0; i < response.users.length; i++) { var current = response.users[i], $o = $('#wpwhosonline-' + current.user_id); console.dir(current.user_id, current.timestamp); if( $o.length == 0 ) { $o = $('<li/>').attr('id', 'wpwhosonline-' + current.user_id). addClass( 'wpwhosonline-row wpwhosonline-active' ). prependTo( '.wpwhosonline-list' ); console.log($o); } $o.html( current.html ). data('wpwhosonline', current.timestamp); } } console.log('Done'); }); toggleUpdates(); updateRecents(); }; // from http://snippets.dzone.com/posts/show/5925 function formatDate(formatDate, formatString) { if(formatDate instanceof Date) { var months = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); var yyyy = formatDate.getFullYear(); var yy = yyyy.toString().substring(2); var m = formatDate.getMonth(); var mm = m < 10 ? "0" + m : m; var mmm = months[m]; var d = formatDate.getDate(); var dd = d < 10 ? "0" + d : d; var h = formatDate.getHours(); var hh = h < 10 ? "0" + h : h; var n = formatDate.getMinutes(); var nn = n < 10 ? "0" + n : n; var s = formatDate.getSeconds(); var ss = s < 10 ? "0" + s : s; formatString = formatString.replace(/yyyy/i, yyyy); formatString = formatString.replace(/yy/i, yy); formatString = formatString.replace(/mmm/i, mmm); formatString = formatString.replace(/mm/i, mm); formatString = formatString.replace(/m/i, m); formatString = formatString.replace(/dd/i, dd); formatString = formatString.replace(/d/i, d); formatString = formatString.replace(/hh/i, hh); formatString = formatString.replace(/h/i, h); formatString = formatString.replace(/nn/i, nn); formatString = formatString.replace(/n/i, n); formatString = formatString.replace(/ss/i, ss); formatString = formatString.replace(/s/i, s); return formatString; } else { return ""; } } function updateRecents(){ var now = Math.round(new Date().getTime()/1000.0); var active = 120; // 2 minutes var recent = 600; // 10 minutes var ancient = 7200; // 2 hours $('.wpwhosonline-row').each(function(){ var $o = $(this); var since, oclass, remove; var last = $o.data('wpwhosonline'); since = now - last; if(since > ancient) { oclass = "wpwhosonline-ancient"; remove = "wpwhosonline-recent wpwhosonline-active"; } else if(since > recent) { oclass = "wpwhosonline-recent"; remove = "wpwhosonline-ancient wpwhosonline-active"; } else { oclass = "wpwhosonline-active"; remove = "wpwhosonline-ancient wpwhosonline-recent"; // no longer active; remove "Online now!' text if(since > active && $o.text() == 'Online now!' ) { var theDate = new Date(last * 1000); $o.text( formatDate(theDate, 'dd mmm yyyy HH:MM:ss') ); } } $o.addClass( oclass ).removeClass( remove ); }); } function toggleUpdates() { if (0 == wpwhosonline.getwpwhosonlineUpdate) { wpwhosonline.getwpwhosonlineUpdate = setInterval(getwpwhosonline, 30000); } else { clearInterval(wpwhosonline.getwpwhosonlineUpdate); wpwhosonline.getwpwhosonlineUpdate = '0'; } } toggleUpdates(); updateRecents(); }); I had a thread on here earlier in which one of you helped me immensely. As I mentioned in that thread, I know very little about javascript. The code I was given basically handles one user, and does it very well. I have since attended a meeting in which I was asked to have multiple users on one page. For example: My current code handles the following: Name - Hours - series of radio button choices. My updated request is the following: Name - Hours - series of radio button choices Name - Hours - series of radio button choices Name - Hours - series of radio button choices Name - Hours - series of radio button choices etc. up to 15 total users. I have tried to adjust the javascript, but with my lack of knowledge in this area I keep breaking it. Any help would again be greatly appreciated, here is my code: Code: <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Jared Daily Sales Goal Calculation Worksheet</title> </head> <script type="text/javascript"> var IE = navigator.appName == "Microsoft Internet Explorer"; var nSets = ""; var answeredQ = []; function advanceTo(nextQ,nQ){ var currAns = answeredQ[nQ.name.replace(/q/,"")-1]; if (currAns != "-" && currAns != nQ.value) { var nFloor = nQ.parentNode.parentNode.id.replace(/f/,"")-1; for (i=0; i<nSets.length; i++) { if (i > nFloor) { nSets[i].style.display = "none"; } } } nSets[nextQ-1].style.display = ""; answeredQ[nQ.name.replace(/q/,"")-1] = nQ.value; } function init(){ nSets = document.forms[0].getElementsByTagName('fieldset'); for (i=1; i<nSets.length; i++) { nSets[i].style.display = "none"; answeredQ[answeredQ.length] = "-"; } } IE ? attachEvent('onload', init, false) : addEventListener('load', init, false); </script> <style type="text/css"> body {background-color: #ffffff; margin-top: 60px;} fieldset {border: 0px} td { font-family:Arial, Helvetica, sans-serif; font-size:12px;} h1 { font-family:Arial, Helvetica, sans-serif; font-size:12px; font-weight:bold;} </style> <body> <cfform action="" method="post"> <!--- Header ---> <table border="1"> <tr> <td> <table align="left"> <tr bgcolor="#E5E5E5"> <td>Name</td> <td>Hours</td> <td colspan="4"></td> </tr> <!--- Emp 1 ---> <tr bgcolor="#ffffff"> <td valign="top"><input name="" size="10"></td> <td valign="top"><input name="" size="10"></td> <td valign="top"> <fieldset id="f1"> <!-- Question 1 --> <label><input type="radio" name="e1q1" value="Diamond1" onclick="advanceTo(2,this)">Diamond</label> <label><input type="radio" name="e1q1" value="Perimeter1" onclick="advanceTo(3,this)">Perimeter</label> </fieldset> </td> <td valign="top"> <fieldset id="f2"> <!-- Question 2 --> |<label><input type="radio" name="e1q2" value="GM1">GM</label> <label><input type="radio" name="e1q2" value="AGM1">AGM</label> <label><input type="radio" name="e1q2" value="DDM1">DDM</label> <label><input type="radio" name="e1q2" value="FT1" onclick="advanceTo(4,this)">Full Time</label> <label><input type="radio" name="e1q2" value="PT1" onclick="advanceTo(4,this)">Part Time</label> </fieldset> </td> <td valign="top"> <fieldset id="f3"> <!-- Question 3 --> <label><input type="radio" name="e1q3" value="PDM">PDM</label> <label><input type="radio" name="e1q3" value="RL">RL</label> <label><input type="radio" name="e1q3" value="FT1" onclick="advanceTo(4,this)">Full Time</label> <label><input type="radio" name="e1q3" value="PT1" onclick="advanceTo(4,this)">Part Time</label> </fieldset> </td> <td valign="top"> <fieldset id="f4"> <!-- Question 4 --> |<label><input type="radio" name="e1q4" value="Tenured1">Tenured</label> <label><input type="radio" name="e1q4" value="NonTenured1">Under 2 Years</label> </fieldset> </td> </tr> </table> </td></tr></table> </cfform> </body> </html> Hi Javascript Gurus, I've made a webpage which displays a list of timeslots in GMT time, and also conveniently displays the GMT times in the clients local time, depending on the timezone they have on their comp. The output on my computer (Melbourne +10 GMT) is perfect. It even anticipates a future Daylight Savings change. It looks like this: Code: Option 1: Saturday 24th Oct 20:00 GMT = YOUR time: Sunday, October 25, 2009 7:00:00 AM Option 2: Saturday 24th Oct 22:00 GMT = YOUR time: Sunday, October 25, 2009 9:00:00 AM Option 3: Saturday 24th Oct 24:00GMT = YOUR time: Sunday, October 25, 2009 11:00:00 AM Option 4: Sunday 25th Oct 20:00GMT = YOUR time: Monday, October 26, 2009 7:00:00 AM Option 5: Sunday 25th Oct 22:00 GMT = YOUR time: Monday, October 26, 2009 9:00:00 AM Option 6: Sunday 25th Oct 24:00 GMT = YOUR time: Monday, October 26, 2009 11:00:00 AM BUT when I switch my computer to a North American, or European time (to test) the Saturday times are one hour later than the Sunday ones!?! Here's an example (Central US time -6 GMT): Code: Option 1: Saturday 24th Oct 20:00 GMT = YOUR time: Saturday, October 24, 2009 3:00:00 PM Option 2: Saturday 24th Oct 22:00 GMT = YOUR time: Saturday, October 24, 2009 5:00:00 PM Option 3: Saturday 24th Oct 24:00GMT = YOUR time: Saturday, October 24, 2009 7:00:00 PM Option 4: Sunday 25th Oct 20:00GMT = YOUR time: Sunday, October 25, 2009 2:00:00 PM Option 5: Sunday 25th Oct 22:00 GMT = YOUR time: Sunday, October 25, 2009 4:00:00 PM Option 6: Sunday 25th Oct 24:00 GMT = YOUR time: Sunday, October 25, 2009 6:00:00 PM Daylight Savings happens in the US in November, so what's going on? thanks, Andrew K I frequent a forum that has a pretty large community. There are a few users there I don't particularly care for. I would like to make a Greasemonkey compatible javascript code that would allow me to completely erase their posts from the page. What I want to happen is that every time Code: <li class="kpost-username"> <a rel="nofollow" title="" href="/index.php/component/kunena/profile/userid-80?Itemid=0" class="kwho-user">Rolepgeek</a> </li> appears it deletes the parent <table class="kmsg"> node. I know that I can find each of those code snippets with Code: document.getElementById('kpost-usernmae') however I am not sure how I would go about defining if it includes Code: <li class="kpost-username"> <a rel="nofollow" title="" href="/index.php/component/kunena/profile/userid-80?Itemid=0" class="kwho-user">Rolepgeek</a> </li> or not, nor am I sure on how to tell the code to delete the parent <table class="kmsg"> node when it does include it. I've been messing around a bit with some code, and I understand the general idea of how it should work, however I do not know the syntax in order to get it to work. Any help would be appreciated. HTML to a full post: Code: <table class="kmsg"> <tbody> <tr> <td class="kprofile-top"> <ul id="kpost-profiletop"> <li class="kpost-smallicons"> <span title="Gender: Unknown" class="kicon-profile kicon-profile-gender-unknown"></span> <a title="Click here to send a private message to this user." href="/index.php/component/uddeim/?task=new&recip=80&Itemid=213"><span alt="Click here to send a private message to this user." class="kicon-profile kicon-profile-pm"></span></a> <br> <div> <span class="kpost-userposts">Posts:334</span> </div> </li> <li class="kpost-personal"> Chaos will consume all... </li> <li class="kpost-avatar"> <a rel="nofollow" title="" href="/index.php/component/kunena/profile/userid-80?Itemid=0" class="kwho-user"><span class="kavatar"><img style="max-width: 72px; max-height: 72px" alt="" src="http://thekingdomsmc.com/media/kunena/avatars/resized/size72/users/avatar80.jpg" class="kavatar vbavnparnxybaoekjwjh"></span></a> </li> <li class="kpost-username"> <a rel="nofollow" title="" href="/index.php/component/kunena/profile/userid-80?Itemid=0" class="kwho-user">Rolepgeek</a> </li> <li class="kpost-userrank"> Merchant </li> <li class="kpost-userrank-img"> <img alt="" src="http://thekingdomsmc.com/components/com_kunena/template/default/images/ranks/rank3.gif"> </li> <li><span class="kicon-button kbuttononline-yes"><span class="online-yes"><span>NOW ONLINE</span></span></span></li> <li class="kpost-karma"> <span class="kmsgkarma"> Karma: -9 <a rel="nofollow" title="" href="/index.php/component/kunena/4-off-topic/karma/userid-80?do=decrease&pid=13229&0409ea1d6b1360d1a0a24ee6206c0bf4=1&Itemid=0"><span title="Smite" border="0" alt="Karma-" class="kkarma-minus"> </span></a> <a rel="nofollow" title="" href="/index.php/component/kunena/4-off-topic/karma/userid-80?do=increase&pid=13229&0409ea1d6b1360d1a0a24ee6206c0bf4=1&Itemid=0"><span title="Applaud" border="0" alt="Karma+" class="kkarma-plus"> </span></a> </span> </li> </ul> </td> </tr> <tr> <td class="kmessage-top"> <div class="kmsgbody"> <div class="kmsgtext"> Yeah. And it would be pointless, seeing as how I won't. </div> </div> <div style="display: none" class="kreply-form" id="kreply13229_form"> <form enctype="multipart/form-data" name="postform" method="post" action="/index.php/component/kunena/post?Itemid=0"> <input type="hidden" value="13229" name="parentid"> <input type="hidden" value="4" name="catid"> <input type="hidden" value="post" name="action"> <input type="hidden" value="1" name="0409ea1d6b1360d1a0a24ee6206c0bf4"> <input type="hidden" value="Shigan" name="authorname"> <input type="text" value=" To all non-bronies." maxlength="50" class="inputbox" size="35" name="subject"><br> <textarea cols="60" rows="6" name="message" class="inputbox"></textarea><br> <input type="checkbox" value="1" name="subscribeMe"> <i>Check this box to be notified of replies to this topic.</i> <br> <input type="submit" title="Click here to submit your message" value="Submit" name="submit" class="kbutton kreply-submit"> <input type="reset" title="Click here to cancel your message" value="Cancel" name="cancel" class="kbutton kreply-cancel"> <small>Note: BBcode and smileys are still usable.</small> </form> </div> </td> </tr> <tr> <td class="kbuttonbar-top"> <div> <div class="kmsgsignature"> With Order, come entropy,<br> With Life, comes death,<br> With Light, comes shadow.<br> <br> <div style="text-align: center">If one does not know Chaos, one does not realize the potential within themselves.</div> </div> </div> <div class="kmessage-editmarkup-cover"> <span class="kmessage-informmarkup"><a rel="nofollow" title="" href="/index.php/component/kunena/4-off-topic/13229-re-to-all-non-bronies/report?Itemid=0">Report to moderator</a></span> </div> <div class="kmessage-buttons-cover"> <div class="kmessage-buttons-row"> <a id="kreply13229" rel="nofollow" title="Quick Reply" href="/index.php/component/kunena/4-off-topic/13229-re-to-all-non-bronies/post?do=reply&Itemid=0" class="kicon-button kbuttoncomm btn-left kqreply"><span class="reply"><span>Quick Reply</span></span></a> <a rel="nofollow" title="Reply" href="/index.php/component/kunena/4-off-topic/13229-re-to-all-non-bronies/post?do=reply&Itemid=0" class="kicon-button kbuttoncomm btn-left"><span class="reply"><span>Reply</span></span></a> <a rel="nofollow" title="Quote" href="/index.php/component/kunena/4-off-topic/13229-re-to-all-non-bronies/post?do=quote&Itemid=0" class="kicon-button kbuttoncomm btn-left"><span class="quote"><span>Quote</span></span></a> </div> </div> <div class="kpost-thankyou"> <a rel="nofollow" title="I want to thank you for this message!" href="/index.php/component/kunena/4-off-topic/thankyou?pid=13229&0409ea1d6b1360d1a0a24ee6206c0bf4=1&Itemid=0" class="kicon-button kbuttonuser btn-left"><span class="thankyou"><span>Thank You</span></span></a></div> </td> </tr> </tbody> </table> Hello. Please excuse my ignorance but I am not too clued up on javascript. Im hoping someone may be able to help me out here. I have managed to locate a script which will find text on a page, but I have a couple of requests. Firstly the script will only search up. I would like the search box to be at the top of a page but the only way to get it to work correctly is placing it at the bottom of the page. Secondly would some kind soul advise me how to place the script in an external file and then link to it. Thanks in advance. This is the script itself - no error messages are generated. Code: <script language="javascript" type="text/javascript"> function getXMLHTTPRequest() { try { req = new XMLHTTPRequest(); } catch(err1) { try { req = new ActiveXObject("Msxm12.XMLHTTP"); } catch(err2) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch(err3) { req = false; } } } return req; } var http = getXMLHTTPRequest(); function getCattle(animal_id){ var myurl = 'find_cattle.php'; var CattleValue=animal_id; var modurl= myurl+"?d="+CattleValue; **************the alert returns the correct value from my selection and after than nothing, I never get my alert from the response portion alert("Looking For "+modurl); ******* http.open("GET", modurl, true); http.onreadystatechange=useHttpResponse; http.send(null); } function useHttpResponse(){ ************It never gets to this response alert("Made It To Response"); if (http.readyState == 4) { if(http.status == 200) { var ListValue = http.responseXML.getElementsByTagName("animal_id")[0]; document.getElementsById('cattle_data').innerHTML = animal_id.childNodes[0].nodeValue; } } } </script> thank you |