jQuery 去除表单空值 serialize how to eliminate empty fields

1.  Try adding this $('input', '#submForm').each(function(){ $(this).val() == "" && $(this).remove(); }) OR $('input:text[value=""]', '#submForm').remove(); before var serialized = $('#submForm').serialize() 来源:http://stackoverflow.com/a/6240625 You cannot use attribute selector for value as it is a changing property. 2. Use .… Read More

Linux Netcat 命令——网络工具中的瑞士军刀

netcat是网络工具中的瑞士军刀,它能通过TCP和UDP在网络中读写数据。通过与其他工具结合和重定向,你可以在脚本中以多种方式使用它。使用netcat命令所能完成的事情令人惊讶。 netcat所做的就是在两台电脑之间建立链接并返回两个数据流,在这之后所能做的事就看你的想像力了。你能建立一个服务器,传输文件,与朋友聊天,传输流媒体或者用它作为其它协议的独立客户端。 下面是一些使用netcat的例子. [A(172.31.100.7) B(172.31.100.23)] Linux netcat 命令实例: 1,端口扫描 端口扫描经常被系统管理员和黑客用来发现在一些机器上开放的端口,帮助他们识别系统中的漏洞。 $n… Read More

Magento 获取系统设置 How to get data from Magento System Configuration

I just wandering on how I can get the configuration data for my custom module. The configuration can be set from the admin system->configuration and how to pull it in frontend? 解决: $configValue = Mage::getStoreConfig('sectionName/groupName/fieldName'); sectionName, groupName and fieldName are present in etc/system.xml file of your module. The… Read More

Magento: 解决 Bootstrap 3 与prototype并用的时候, 下拉菜单消失的问题 Bootstrap 3 dropdown menu disappears when used with prototype.js

方法一 :  使用友善的文件 EASY FIX: Just replace Magento’s prototype.js file with this bootstrap friendly one: https://raw.github.com/zikula/core/079df47e7c1f536a0d9eea2993ae19768e1f0554/src/javascript/ajax/original_uncompressed/prototype.js You can see the changes made in the prototype.js file to fix the bootstrap issue here: https://… Read More

imagesLoaded-检测图片是否正确加载的js插件

简要教程 imagesLoaded是一款用于检测页面中的图片是否被加载的js插件。imagesLoaded是非常有用的插件,当你的页面中某幅图片没有被加载时,默认会显示一个红叉或图片alt文本,imagesLoaded可以将未加载的图片替换为你设置的图片。 安装 你可以通过Bower或npm来安装giantess分类过滤和排序插件。 bower install imagesloaded npm install imagesloaded 或者直接使用下载包中的imagesloaded.pkgd.js文件及压缩版的imagesloaded.pkgd.min.js。在页面中将它引入即可。 <script src="/… Read More

sed 执行错误:sed: 1: “…”: Invalid command code f

运行 grep -l \'texttofind\' * | xargs sed -i 's/toreplace/replacewith/g' Im getting this error when I run the above command in the terminal. sed: 1: "forkliftDailyChecklistW ...": invalid command code f 解决: I figured out what was wrong. I needed to add '' after the -i and before the 's/../../': grep -l \'texttofind\' * | xargs sed -i '' 's/toreplace/replacewi…

bootstrap 3 多选框 awesome bootstrap checkbox

Awesome Bootstrap Checkbox Font Awesome Bootstrap Checkboxes & Radios plugin. Pure CSS way to make inputs look prettier. No Javascript! Demo Use First just include awesome-bootstrap-checkbox.css somewhere in your HTML, or add the equivalent files to your Sass / Less configuration. Next, everything is based on code convention. Here is checkbox ma… Read More

Magento 创建用户代码 Creating a new customer in Magento(RESTful,PHP)

$customer = Mage::getModel('customer/customer'); //$customer = new Mage_Customer_Model_Customer(); $password = 'iks123456'; $email = 'gotodiscuss@ikeepstudying.com'; $customer->setWebsiteId(Mage::app()->getWebsite()->getId()); $customer->loadByEmail($email); //Zend_Debug::dump($customer->debug()); ex… Read More