Search Results

Search found 38 results on 2 pages for 'tauren'.

Page 1/2 | 1 2  | Next Page >

  • Problems with jQuery getJSON using local files in Chrome

    - by Tauren
    I have a very simple test page that uses XHR requests with jQuery's $.getJSON and $.ajax methods. The same page works in some situations and not in others. Specificially, it doesn't work in Chrome on Ubuntu. I'm testing on Ubuntu 9.10 with Chrome 5.0.342.7 beta and Mac OSX 10.6.2 with Chrome 5.0.307.9 beta. It works correctly when files are installed on a web server from both Ubuntu/Chrome and Mac/Chrome (try it out here). It works correctly when files are installed on local hard drive in Mac/Chrome (accessed with file:///...). It FAILS when files are installed on local hard drive in Ubuntu/Chrome (access with file:///...). The small set of 3 files can be downloaded in a tar/gzip file from here: http://issues.tauren.com/testjson/testjson.tgz When it works, the Chrome console will say: XHR finished loading: "http://issues.tauren.com/testjson/data.json". index.html:16Using getJSON index.html:21 Object result: "success" __proto__: Object index.html:22success XHR finished loading: "http://issues.tauren.com/testjson/data.json". index.html:29Using ajax with json dataType index.html:34 Object result: "success" __proto__: Object index.html:35success XHR finished loading: "http://issues.tauren.com/testjson/data.json". index.html:46Using ajax with text dataType index.html:51{"result":"success"} index.html:52undefined When it doesn't work, the Chrome console will show this: index.html:16Using getJSON index.html:21null index.html:22Uncaught TypeError: Cannot read property 'result' of null index.html:29Using ajax with json dataType index.html:34null index.html:35Uncaught TypeError: Cannot read property 'result' of null index.html:46Using ajax with text dataType index.html:51 index.html:52undefined Notice that it doesn't even show the XHR requests, although the success handler is run. I swear this was working previously in Ubuntu/Chrome, and am worried something got messed up. I already uninstalled and reinstalled Chrome, but that didn't help. Can someone try it out locally on your Ubuntu system and tell me if you have any troubles? Note that it seems to be working fine in Firefox.

    Read the article

  • Synergy Key Mapping

    - by Tauren
    I'm running a Synergy server on Ubuntu and a Synergy+ client on OSX. The server has a standard windows keyboard with shift, ctrl, windows, and alt keys. My MacBookPro has shift, fn, control, alt/option, and command keys. When I press ctrl-c, ctrl-v, etc, the appropriate copy/paste action doesn't happen on the Mac, but it does in Ubuntu. If I'm controlling the mac, and press alt-c, alt-v, then I get the copy/paste action. So I played around with key mapping in synergy.conf and found that the following allows me to do copy/paste with ctrl-c/ctrl-v: section: screens godzilla: mbp.local: ctrl = alt alt = ctrl end Is this all that I need to do? Or are there other mappings that will help as well? The synergy configuration page refers to the following key mappings. What are the equivalent keys for each of these on the Windows keyboard and Mac keyboard? What is a meta or super key? shift = {shift|ctrl|alt|meta|super|none} ctrl = {shift|ctrl|alt|meta|super|none} alt = {shift|ctrl|alt|meta|super|none} meta = {shift|ctrl|alt|meta|super|none} super = {shift|ctrl|alt|meta|super|none} Thanks!

    Read the article

  • DNS zone file SPF configuration to support sending mail from multiple servers and gmail

    - by Tauren
    I want to configure SPF on a domain to allow mail to be sent from: the x.com website server (x.com and www.x.com - both at same IP) it's MX servers (smtp.x.com, mx.x.com, mail.x.com) another server that isn't listed as an MX server (somehost.x.com) via gmail using an account that has authenticated use of [email protected] Will this zone file work? If not, what are the problems with it? $ttl 38400 @ IN SOA ns1.x.com. hostmaster.x.com. ( 201003092 ; serial 8H ; refresh 15M ; retry 1W ; expire 1H ) ; minimum @ NS ns1.x.com. @ NS ns2.x.com. @ MX 10 mx.x.com. @ MX 20 smtp.x.com. @ MX 30 mailhost.x.com. ; SPF records @ IN TXT "v=spf1 a mx a:somehost.x.com include:_spf.google.com ~all" mx IN TXT "v=spf1 a -all" smtp IN TXT "v=spf1 a -all" mailhost IN TXT "v=spf1 a -all" Questions: Is _spf.google.com the right thing to include for gmail.com, or is it only for Google Hosted Apps? If only for Google Apps, what should I include to send from gmail.com? If mail shouldn't be sent from anywhere else, is it safe to use -all instead of ~all? Does it make sense to add specific SPF records for each of the mail servers? Any other problems with the zone file? I want to confirm these things before making changes to my zone file. The file has SPF configured basically the same now, just without google.com and somehost, but I want to make sure I won't break things when I change it.

    Read the article

  • Move postfix maildir files from one mail server to another

    - by Tauren
    I have a new mail server configured as described in this howto: http://howtoforge.com/virtual-users-domains-postfix-courier-mysql-squirrelmail-ubuntu-9.10 I also have an ancient mail server configured very similarly (using the same HOWTO, just for Fedora Core 6, if I recall correctly). Earlier today I had to switch from the old server to the new one, and the old one is no longer online. However, after I had migrated everything and switched it all over, I discovered a bunch of undelivered mail in the queue. It got delivered to the local mailboxes on the old server, so now there are a bunch of messages on it that I'd like to move to the new server. The new server has already received new messages, so I need to merge the files together somehow. For each user with an email of [email protected], there are files like this on both servers: /home/vmail/customer.com/username/maildirsize /home/vmail/customer.com/username/courierpop3dsizelist /home/vmail/customer.com/username/new/1271481177.Vca01I6006bM580357.mailhost.mydomain.com Can I simply copy the hundreds of files in the various new directories on the old server to the corresponding new directories on the new server? Will the maildirsize and courierpop3dsizelist files get updated automatically, or do I need to do something to update them?

    Read the article

  • Best practice for assigning private IP ranges?

    - by Tauren
    Is it common practice to use certain private IP address ranges for certain purposes? I'm starting to look into setting up virtualization systems and storage servers. Each system has two NICs, one for public network access, and one for internal management and storage access. Is it common for businesses to use certain ranges for certain purposes? If so, what are these ranges and purposes? Or does everyone do it differently? I just don't want to do it completely differently from what is standard practice in order to simplify things for new hires, etc.

    Read the article

  • Best practice for system clock sync on KVM host

    - by Tauren
    I have an Ubuntu 9.10 server running as a KVM host with ntpd installed on it. The host system has the correct system time. At the moment I only have a single KVM guest, also Ubuntu 9.10 server. I do not have ntpd installed on it, and I just discovered the clock is about 6 minutes slow. It wasn't that way when it was installed about a month ago. I thought that I only needed to keep the host clock synchronized and that the guests used the host clock. But maybe that is a memory from using OpenVZ. I believe the reasoning was related to only the host could modify the physical system clock. Is running ntpd on both the host and all the guests the correct thing to do? Or is there something else that is preferred? How should I keep the guest clocks in sync?

    Read the article

  • Shared firewall or multiple client specific firewalls?

    - by Tauren
    I'm trying to determine if I can use a single firewall for my entire network, including customer servers, or if each customer should have their own firewall. I've found that many hosting companies require each client with a cluster of servers to have their own firewall. If you need a web node and a database node, you also have to get a firewall, and pay another monthly fee for it. I have colo space with several KVM virtualization servers hosting VPS services to many different customers. Each KVM host is running a software iptables firewall that only allows specific ports to be accessed on each VPS. I can control which ports any given VPS has open, allowing a web VPS to be accessed from anywhere on ports 80 and 443, but blocking a database VPS completely to the outside and only allowing a certain other VPS to access it. The configuration works well for my current needs. Note that there is not a hardware firewall protecting the virtualization hosts in place at this time. However, the KVM hosts only have port 22 open, are running nothing except KVM and SSH, and even port 22 cannot be accessed except for inside the netblock. I'm looking at possibly rethinking my network now that I have a client who needs to transition from a single VPS onto two dedicated servers (one web and one DB). A different customer already has a single dedicated server that is not behind any firewall except iptables running on the system. Should I require that each dedicated server customer have their own dedicated firewall? Or can I utilize a single network-wide firewall for multiple customer clusters? I'm familiar with iptables, and am currently thinking I'll use it for any firewalls/routers that I need. But I don't necessarily want to use up 1U of space in my rack for each firewall, nor the power consumption each firewall server will take. So I'm considering a hardware firewall. Any suggestions on what is a good approach?

    Read the article

  • Possible to use LVM partitions inside a vmbuilder created KVM virtual machine?

    - by Tauren
    I have an Ubuntu 9.10 host system with LVM partitions running KVM. I've been creating VMs using vmbuilder using LVM partitions for each VM instead of files for the VMs. When I configure a VM using vmbuilder --part, the partitions in the file I'm using are created as regular partitions (sda1, sda2, etc.). What I'd like to do is use LVM inside of the VM in case I need to resize the partitions at some point. But I don't see any options for doing that using the vmbuilder tool. It seems like this might be a common request to avoid using kpartx, etc. Is there something I'm missing, or is this just not possible with vmbuilder?

    Read the article

  • Synergy Key Mapping

    - by Tauren
    I'm running a Synergy server on Ubuntu and a Synergy+ client on OSX. The server has a standard windows keyboard with shift, ctrl, windows, and alt keys. My MacBookPro has shift, fn, control, alt/option, and command keys. When I press ctrl-c, ctrl-v, etc, the appropriate copy/paste action doesn't happen on the Mac, but it does in Ubuntu. If I'm controlling the mac, and press alt-c, alt-v, then I get the copy/paste action. So I played around with key mapping in synergy.conf and found that the following allows me to do copy/paste with ctrl-c/ctrl-v: section: screens godzilla: mbp.local: ctrl = alt alt = ctrl end Is this all that I need to do? Or are there other mappings that will help as well? The synergy configuration page refers to the following key mappings. What are the equivalent keys for each of these on the Windows keyboard and Mac keyboard? What is a meta or super key? shift = {shift|ctrl|alt|meta|super|none} ctrl = {shift|ctrl|alt|meta|super|none} alt = {shift|ctrl|alt|meta|super|none} meta = {shift|ctrl|alt|meta|super|none} super = {shift|ctrl|alt|meta|super|none} Thanks!

    Read the article

  • Truncate text to fit table cell without wrapping using css or jquery

    - by Tauren
    I want the text in one of the columns of a table to not wrap, but to just truncate so that it fits within the current size of the table cell. I don't want the table cell to change size, as I need the table to be exactly 100% the width of the container. This is because the table with 100% width is inside of a positioned div with overflow: auto (it's actually inside of a jquery UI.Layout panel). I tried both overflow: hidden and the text still wrapped. I tried white-space: nowrap, but it stretched the table wider than 100% and added a horizontal scroll bar. div.container { position: absolute; overflow: auto; /* user can slide resize bars to change the width & height */ width: 600px; height: 300px; } table { width: 100% } td.nowrap { overflow: hidden; white-space: nowrap; } <div class="container"> <table> <tr> <td>From</td> <td>Subject</td> <td>Date</td> </tr> <tr> <td>Bob Smith</td> <td class="nowrap"> <strong>Message subject</strong> <span>This is a preview of the message body and could be long.</span> </td> <td>2010-03-30 02:18AM</td> </tr> </table> </div> Is there a way using css to solve this? If I had a fixed table cell size, then overflow:hidden would truncate anything that flows over, but I can't used a fixed size as I want the table to stretch with the UI.Layout panel size. If not, then how would I solve this with jquery? My use case is similar to the gmail interface, where an email subject is bolded and the beginning of the message body is shown, but then truncated to fit.

    Read the article

  • Open payment gateway libraries for Java, Python, Ruby, and PHP

    - by Tauren
    I'm looking for generic and open source payment libraries that support many different payment processor APIs. In other words, I'd like to develop an application using a single payment processing API, but be able to easily switch between payment gateways, such as Authorize.Net, Payflow Pro, Braintree, PayPal, Google, Amazon, etc. This question gives some Java solutions, but the suggestions all look horrible. Isn't there anything more like ActiveMerchant for Java? I really need a good Java solution, to the point of building my own if necessary. But I don't want to reinvent the wheel if it exists. Are there any solutions for Python or PHP? Ideally, I'd like to find something similar to Ruby's ActiveMerchant, which looks exceptionally complete. Are there any other Ruby solutions?

    Read the article

  • jQuery UI Tabs customization for many tabs

    - by Tauren
    I'd like to implement a tab bar using jquery-ui-tabs that has been customised to work like it does on HootSuite. Try this on HootSuite to see what I mean: Log in to your hootsuite.com account Click the + symbol to the right of your tabs Add tabs named "MMMMMMMMMMMMMMMMM" until a "More..." tab appears You'll see this: HootSuite includes the following features, all of which I would like to do: Fit as many tabs as possible onto the screen. Users with larger screens would see more tabs. If they run out of space, a "More..." tab would appear with a drop-down list Clicking onto the More tab would drop down a list of additional tabs Tabs can be dragged and rearranged. Tabs in the More drop-down list can be dragged to the tab bar Delete tabs with a small X next to the tab name Add tabs with a + icon to the right of the last tab I already have a tab bar working that does 4 and 6. I found a Paging Tab Plugin which is pretty cool, but works differently. Does anyone know of plugins or techniques that would help me accomplish the above? My thought is to not really make the More tab a real tab, but just an object that looks like a tab. I'd add logic to the tabs.add method to calculate if another tab can fit. If it can't, then I would add the details of the tab to my separate "More" list. There'd be a fair amount of effort to get this all working, so if there are any plugins that would help, I'd love to hear about them.

    Read the article

  • Middleware for MongoDB or CouchDB with jQuery Ajax/JSON frontend

    - by Tauren
    I've been using the following web development stack for a few years: java/spring/hibernate/mysql/jetty/wicket/jquery For certain requirements, I'm considering switching to a NoSQL datastore with an AJAX frontend. I would probably build the frontend with jQuery and communicate with the web application middleware using JSON. I'm leaning toward MongoDB because of more dynamic query capabilities, but am still considering CouchDB. I'm not sure what to use in the middle. Probably something RESTful? My preference is to stick with Java (or maybe Scala or Groovy) since I'm using tools like Drools for rules and Shiro for security. But then again, I want to pick something that is quick an easy to work with, so I'm open to other solutions. If you are building ajax/json/nosql solutions, I'd like to hear details about what tools you are using and any pros/cons you've found to using them. Thanks!

    Read the article

  • CSS for toolbar with UI Slider centered between left and right buttons

    - by Tauren
    I'm attempting to create a 100% width toolbar. This toolbar needs to have a variable number of buttons aligned to the left side, as well as a variable number of buttons aligned to the right. That's the easy part. But now I want to put a jQuery UI slider in the center that takes up the full remaining space between the buttons on the left and the buttons on the right. I'm having troubles figuring out a pure-CSS way of doing this. I've tried something like below, but I really don't want to have fixed percentage widths. If there is only one button on the left and one on the right, then I want the centered slider to take the full space between them, not just 33% of the full width. .toolbar {width: 100%;} .toolbar .toolbar-left {float: left;width: 33%;} .toolbar .toolbar-right {float: right;width: 33%;} .toolbar .toolbar-center {margin: 0 auto;width: 33%;} I'm using UI Buttons for my buttons and styling -- see an example. In that example, there is a toolbar that is the full width of the page. Imagine the two right most sets of buttons being aligned to the right of the toolbar. Then in the middle empty space, I want to put a UI Slider, and use all the space between buttons (minus some padding). Is there a way to do this with CSS, or will I need to whip up some javascript to position things properly?

    Read the article

  • Formatting and pretty printing dates with jquery

    - by Tauren
    I need to display dates in a couple different ways in an app built with jquery. In some situations, I need the typical "yyyy-mm-dd hh:mma" type of formatting, with all of it's different permutations. In other cases, I need to show dates "pretty printed" similar to how StackOverflow does them: 5 seconds ago 12 minutes ago 3 hours ago yesterday 2 days ago My application already uses JQuery UI DatePicker which includes a formatDate() function, but as far as I can tell, there is no way to use it outside of the datepicker. I want to format dates that aren't associated with a datepicker. Is it possible to do this using DatePicker? The DateJS library can parse dates like "12 minutes ago", but as far as I can tell, it cannot take a Date object and format strings like this. It can format the typical "yyyy-mm-dd" types of formats. This library seems pretty heavy as well. John Resig's Pretty Dates looks like it can provide the pretty printing ("2 hours ago"), but it doesn't do the standard formatting. Is there not a single plugin that can do all of this? Is there a way to leverage the DatePicker code so I don't have to load multiple codebases that do the same things?

    Read the article

  • HQL to get elements that possess all items in a set

    - by Tauren
    Currently, I have an HQL query that returns all Members who possess ANY Award from a set of specified Awards: from Member m left join m.awards as a where a.name in ("Trophy","Ribbon"); What I now need is HQL that will return all Members who possess ALL Awards specified in the set of Awards. So, assuming this data: Joe has Trophy, Medal Sue has Trophy, Ribbon Tom has Trophy, Ribbon, Medal The query above would return Joe, Sue, and Tom because all three possess at least one of Trophy or Ribbon. But I need to return only Sue and Tom, because they are the only ones who possess all of the specified awards (Trophy and Ribbon). Here's the class structure (simplified): class Member { private String name; private Set<Award> awards; } class Award { private String name; }

    Read the article

  • Best practices for sending automated daily emails from web service

    - by Tauren
    I am running a web service that currently sends confirmation emails out to new users via the gmail smtp servers. As I'm only getting a few new users each day, this hasn't been a problem. I've recently added new features to the webapp that will require a customized message to be sent out to each user every day. Think of this as similar to the regular messages LinkedIn sends out that give you a status report on the activity in your network. Every user's message will be different. With thousands of users, this means thousands of unique messages will be sent each day. Edit: I've since found that these types of email are called "transactional or relationship messages". Spamtacular has a good article on differentiating between marketing and transactional email. I don't think using gmail's smtp servers will cut it anymore, but I don't know that for sure. I don't know what gmail's maximum outgoing messages per account is (it might be 100/day), but they limit outgoing mail to 500 recipients per message. I'm not sending a single message to 500 recipients, but I'm going to be sending 1000's of customized messages with each recipient getting one per day. I'm interested to learn any best practices for doing this (especially for Java-based webapps). Here are some of my thoughts and concerns on it: Should I set up my own outgoing mail server? If I do this, it seems like I'll have all sorts of other issues to worry about, such as preventing mail server abuse, monitoring bounces, allowing ways to opt-out of emails, etc. Are there any tools or services to help with this? Maybe something like OpenEMM or a services like MailChimp? But those seem focused more toward email marketing campaigns. I don't think I should have the webapp itself handle sending emails as it currently is for new user signups. I'm thinking I should setup a separate messaging server that can access the same backend/datastore as the webapp. Thoughts on this? Should I consider setting up some sort of message queueing service to help with this, such as JMS, RabbitMQ, ActiveMQ, etc.? Do I need to provide users a way to opt-out? Do I need to flag these as bulk messages? I don't really consider these email marketing messages, but I'm unsure what is considered appropriate or proper netiquette. Any advice is appreciated. I'm also very interested in open source tools or web services that simplify things and could help me to ramp up as quickly as possible. Thanks!

    Read the article

  • Jetty startup delay

    - by Tauren
    I'm trying to figure out what would be causing a 1 minute delay in the startup of Jetty. Is it a configuration problem, my application, or something else? I have Jetty 7 (jetty-7.0.1.v20091125 25 November 2009) installed on a server and I deploy a 45MB ROOT.war file into the webapps directory. This is the only webapp configured in Jetty. I then start Jetty with the command: java -DSTOP.PORT=8079 -DSTOP.KEY=mystopkey -Denv=stage -jar start.jar etc/jetty-logging.xml etc/jetty.xml & I get two lines of output right after doing this: 2010-03-07 14:20:06.642:INFO::Logging to StdErrLog::DEBUG=false via org.eclipse.jetty.util.log.StdErrLog 2010-03-07 14:20:06.710:INFO::Redirecting stderr/stdout to /home/zing/jetty-distribution-7.0.1.v20091125/logs/2010_03_07.stderrout.log When I press the enter key, I get my command prompt back. Looking at the log file (logs/2010_03_07.stderrout.log), I see the following at the beginning: 2010-03-07 14:08:50.396:INFO::jetty-7.0.1.v20091125 2010-03-07 14:08:50.495:INFO::Extract jar:file:/home/zing/jetty-distribution-7.0.1.v20091125/webapps/ROOT.war!/ to /tmp/Jetty_0_0_0_0_8080_ROOT.war___.8te0nm/webapp 2010-03-07 14:08:52.599:INFO::NO JSP Support for , did not find org.apache.jasper.servlet.JspServlet 2010-03-07 14:09:51.379:INFO::Set web app root system property: 'webapp.root' = [/tmp/Jetty_0_0_0_0_8080_ROOT.war___.8te0nm/webapp] 2010-03-07 14:09:51.585:INFO::Initializing Spring root WebApplicationContext INFO - ContextLoader - Root WebApplicationContext: initialization started INFO - XmlWebApplicationContext - Refreshing Root WebApplicationContext: startup date [Sun Mar 07 14:09:51 PST 2010]; root of context hierarchy ... Notice the 1 minute long pause between the 3rd and 4th lines. What is Jetty doing at this point? What other things could be going on? It doesn't even look like it has started my Spring initialization yet. Note that I checked my /tmp directory to see if it was simply the time to unpack my war file, but the file had been completely unpacked even at the start of this 1 minute delay.

    Read the article

  • Checking for corrupt war file after mvn install

    - by Tauren
    Is there a maven command that will verify that a WAR file is valid and not corrupt? Or is there some other program or technique to validate zip files? I'm on Ubuntu 9.10, so a linux solution is preferred. On occasion, I end up with a corrupt WAR file after doing mvn clean and mvn install on my project. If I extract the WAR file to my hard drive, an error occurs and the file doesn't get extracted. I believe this happens when my system is in a low-memory condition, because this tends to happen only when lots of memory is in use. After rebooting, doing a mvn install always gives a valid WAR file. Because this happens infrequently, I don't typically test the file by uncompressing it. I transfer the 50MB war file to my server and then restart Jetty with it as the root webapp. But when the file is corrupt, I get a java.util.zip.ZipException: invalid block type error. So I'm looking for a quick way to validate the file as soon as mvn install is completed. Is there a maven command to do this? Any other ideas?

    Read the article

  • Client-side templating frameworks to streamline using jQuery with REST/JSON

    - by Tauren
    I'm starting to migrate some html generation tasks from a server-side framework to the client. I'm using jQuery on the client. My goal is to get JSON data via a REST api and use this data to populate HTML into the page. Right now, when a user on my site clicks a link to My Projects, the server generates HTML like this: <dl> <dt>Clean Toilet</dt> <dd>Get off your butt and clean this filth!</dd> <dt>Clean Car</dt> <dd>I think there's something growing in there...</dd> <dt>Replace Puked on Baby Sheets</dt> </dl> I'm changing this so that clicking My Projects will now do a GET request that returns something like this: [ { "name":"Clean Car", "description":"I think there's something growing in there..." }, { "name":"Clean Toilets", "description":"Get off your butt and clean this filth!" }, { "name":"Replace Puked on Baby Sheets" } ] I can certainly write custom jQuery code to take that JSON and generate the HTML from it. This is not my question, and I don't need advice on how to do that. What I'd like to do is completely separate the presentation and layout from the logic (jquery code). I don't want to be creating DL, DT, and DD elements via jQuery code. I'd rather use some sort of HTML templates that I can fill the data in to. These templates could simply be HTML snippets that are hidden in the page that the application was loaded from. Or they could be dynamically loaded from the server (to support user specific layouts, i18n, etc.). They could be displayed a single time, as well as allow looping and repeating. Perhaps it should support sub-templates, if/then/else, and so forth. I have LOTS of lists and content on my site that are presented in many different ways. I'm looking to create a simple and consistent way to generate and display content without creating custom jQuery code for every different feature on my site. To me, this means I need to find or build a small framework on top of jQuery (probably as a plugin) that meets these requirements. The only sort of framework that I've found that is anything like this is jTemplates. I don't know how good it is, as I haven't used it yet. At first glance, I'm not thrilled by it's template syntax. Anyone know of other frameworks or plugins that I should look into? Any blog posts or other resources out there that discuss doing this sort of thing? I just want to make sure that I've surveyed everything out there before building it myself. Thanks!

    Read the article

  • jquery selector problem with script tags

    - by Tauren
    I'm attempting to select all <script type="text/html"> tags in a page. I use <script> tags to store HTML templates, similar to how John Resig does it. For some reason, the following jquery selector doesn't seem to be selecting anything: $("script[type*=html]").each(function() { alert("Found script "+this.id); }); This markup is in the BODY of the HTML document: <body> <script id="filter-search" type="text/html"> <dt>Search</dt> <dd><input type="text"/></dd> </script> </body> I've also tried putting it into the HEAD of the HTML document, and it is still not found. No alert is ever shown. If I instead change my code to this: $("script[type*=javascript]").each(function() { alert("Found script "+this.id); }); Then it finds only the scripts in the HEAD that have a src to an external file. Scripts in the actual page are not found. For instance, with the following in HEAD: <head> <script type="text/javascript" src="jquery.js" id="jquery"></script> <script type="text/javascript" src="jquery-ui.js" id="ui"></script> <script type="text/javascript" id="custom"> $(document).ready( function() { $("script[type*=javascript]").each(function() { alert("Found script "+this.id); }); $("script[type*=html]").each(function() { alert("Found TEMPLATE script "+this.id); }); }); </script> <script id="filter-test" type="text/html"> <dt>Test</dt> </script> </head> <body> <script id="filter-search" type="text/html"> <dt>Search</dt> <dd><input type="text"/></dd> </script> </body> I get the following alerts: Found script jquery Found script ui The custom and filter-test scripts in the HEAD are not selected, nor is the filter-search script in the body tag. Is this the expected behavior? Why does this not work? I can work around it, but it is annoying that it doesn't work.

    Read the article

  • JSON and Microformats

    - by Tauren
    I'm looking for opinions on whether microformats should be used to name JSON elements. For instance, there is a microformat for physical addresses, that looks like this: <div class="adr"> <div class="street-address">665 3rd St.</div> <div class="extended-address">Suite 207</div> <span class="locality">San Francisco</span>, <span class="region">CA</span> <span class="postal-code">94107</span> <div class="country-name">U.S.A.</div> </div> There is a document available on using JSON and Microformats. The information above could be represented as JSON data like this: "adr": { "street-address":"665 3rd St.", "extended-address":"Suite 207", "locality":"San Fransicso", "region":"CA", "postal-code":"94107", "country-name":"U.S.A." }, The issue I have with this is that I'd like my JSON data to be as lightweight as possible, but still human readable. While still supporting international addresses, I would prefer something like this: "address": { "street":"665 3rd St.", "extended":"Suite 207", "locality":"San Fransicso", "region":"CA", "code":"94107", "country":"U.S.A." }, If I'm designing a new JSON API right now, does it make sense to use microformats from the start? Or should I not really worry about it? Is there some other standard that is more specific to JSON that I should look at?

    Read the article

  • jquery data selector

    - by Tauren
    I need to select elements based on values stored in an element's .data() object. At a minimum, I'd like to select top-level data properties using selectors, perhaps like this: $('a').data("category","music"); $('a:data(category=music)'); Or perhaps the selector would be in regular attribute selector format: $('a[category=music]'); Or in attribute format, but with a specifier to indicate it is in .data(): $('a[:category=music]'); I've found James Padolsey's implementation to look simple, yet good. The selector formats above mirror methods shown on that page. There is also this Sizzle patch. For some reason, I recall reading a while back that jQuery 1.4 would include support for selectors on values in the jquery .data() object. However, now that I'm looking for it, I can't find it. Maybe it was just a feature request that I saw. Is there support for this and I'm just not seeing it? Ideally, I'd like to support sub-properties in data() using dot notation. Like this: $('a').data("user",{name: {first:"Tom",last:"Smith"},username: "tomsmith"}); $('a[:user.name.first=Tom]'); I also would like to support multiple data selectors, where only elements with ALL specified data selectors are found. The regular jquery multiple selector does an OR operation. For instance, $('a.big, a.small') selects a tags with either class big or small). I'm looking for an AND, perhaps like this: $('a').data("artist",{id: 3281, name: "Madonna"}); $('a').data("category","music"); $('a[:category=music && :artist.name=Madonna]'); Lastly, it would be great if comparison operators and regex features were available on data selectors. So $(a[:artist.id>5000]) would be possible. I realize I could probably do much of this using filter(), but it would be nice to have a simple selector format. What solutions are available to do this? Is Jame's Padolsey's the best solution at this time? My concern is primarily in regards to performance, but also in the extra features like sub-property dot-notation and multiple data selectors. Are there other implementations that support these things or are better in some way?

    Read the article

  • Javascript Regex to convert dot notation to bracket notation

    - by Tauren
    Consider this javascript: var joe = { name: "Joe Smith", location: { city: "Los Angeles", state: "California" } } var string = "{name} is currently in {location.city}, {location.state}"; var out = string.replace(/{([\w\.]+)}/g, function(wholematch,firstmatch) { return typeof values[firstmatch] !== 'undefined' ? values[firstmatch] : wholematch; }); This will output the following: Joe Smith is currently in {location.city}, {location.state} But I want to output the following: Joe Smith is currently in Los Angeles, California I'm looking for a good way to convert multiple levels of dot notation found between braces in the string into multiple parameters to be used with bracket notation, like this: values[first][second][third][etc] Essentially, for this example, I'm trying to figure out what regex string and function I would need to end up with the equivalent of: out = values[name] + " is currently in " + values["location"]["city"] + values["location"]["state"];

    Read the article

  • Persisting Joda DateTime instead of Java Date in hibernate

    - by Tauren
    My entities currently contain java Date properties. I'm starting to use Joda Time for date manipulation and calculations quite frequently. This means that I'm constantly having to convert my Dates into Joda DateTime objects and back again. So I was wondering, is there any reason I shouldn't just change my entities to store Joda DateTime objects instead of Java Date objects? Please note that these entities are persisted via Hibernate. I found the jodatime-hibernate project, but I also was reading on the Joda mailing list that it wasn't compatible with newer versions of hibernate. And it seems like it isn't very well maintained. So I'm wondering if it would be best to just continue converting between Date and DateTime, or if it would be wise to start persisting DateTime objects. My concern is being reliant on a poorly maintained library. Edit: Note that one of my objectives is to be better able to store timezone information. Storing just a Date appears to save the date in the local timezone. As my application can be used globally, I need to know the timezone as well. Joda Time Hibernate seems to address this as well in the user guide.

    Read the article

1 2  | Next Page >