我需要从字符串中删除所有特殊字符,除了 - ( )
到目前为止我有这个代码
$q = preg_replace('/[^A-Za-z0-9\-]/', '', $q); //removes ALL characters
Run Code Online (Sandbox Code Playgroud)
如何排除- ( )
?
我有一些JS代码,但Drupal 7无法识别它.我收到以下错误:
TypeError: $ is not a function
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮助我使这个脚本工作吗?我正在使用jQuery v1.4.4.
<script type="text/javascript">
this.screenshotPreview = function(){
/* CONFIG */
xOffset = 10;
yOffset = 30;
// these 2 variable determine popup's distance from the cursor
// you might want to adjust to get the right result
/* END CONFIG */
$("a.screenshot").hover(function(e){
this.t = this.title;
// this.title = "";
var c = (this.t != "") ? "<br/>" + this.t : "";
$("body").append("<p id='screenshot'><img src='"+ this.rel +"' alt='url preview' />"+ c +"</p>");
$("#screenshot") …
Run Code Online (Sandbox Code Playgroud)