首页 \ 问答 \ 在JQuery中连接两个字符串(concat two strings in JQuery)

在JQuery中连接两个字符串(concat two strings in JQuery)

就像上面的标题:如何在JQuery中连接两个字符串?

这是我迄今为止的代码:

$(document).ready(function(){           
    serviceName = '<?=$_GET['services'] . ".php";?>';
    serviceID='<?= "#" .$_GET['services'];?>';
    serviceClass = '<?=$_GET['services'];?>';

    if (serviceName != "") {
        alert(serviceID);
        $('.main_content').load(serviceName);
        $(serviceID).addClass("it");
    }
});

正如你在上面的代码中看到的那样,在变量名serviceID ,我将hashtag和我的GET值连接起来,并且试图将它放在ALERT上,并且结果是正确的,但是当我将它分配给.addClass它不起作用。

任何替代品和解决方案,非常感谢。


Just like the title above: how to concatenate two strings in JQuery?

This is my code so far:

$(document).ready(function(){           
    serviceName = '<?=$_GET['services'] . ".php";?>';
    serviceID='<?= "#" .$_GET['services'];?>';
    serviceClass = '<?=$_GET['services'];?>';

    if (serviceName != "") {
        alert(serviceID);
        $('.main_content').load(serviceName);
        $(serviceID).addClass("it");
    }
});

As you can see in my above code, in variable name serviceID, I am concatenating hashtag and my GET value and I try to put it on ALERT and the result is correct, but when I assign it to .addClass it’s not working.

Any alternatives and solution is much appreciated.


原文:https://stackoverflow.com/questions/23361027
更新时间:2022-12-10 08:12

最满意答案

可能,您获得的错误是由于单独的头文件定义,最重要的是x86架构的不同共享库文件和PowerPC体系结构的不同头文件。 您可以使用“-I”标志更改头文件定义,使用PowerPC体系结构的共享库文件路径更改头文件定义,可以使用-L选项进行更改。 但是这些所有更改都可能在Makefile中实现,所以你只需要改变不同标志中的位置,比如LDFLAG,CFLAGS等。


Probably, the error you are getting is due to the separate header file definition and most importantly different shared library files for x86 architecture and different header files for PowerPC architecture. You can change the header file definitions with the new ones using "-I" flag and the shared library file path which is for PowerPC architecture, which can be changed by using -L option. But these all changes might be implemented in Makefile, so u just need to change the location in different flags, like LDFLAG, CFLAGS etc.

相关问答

更多
  • instanceof GroovyObject ? 我创建了以下Java类: import groovy.lang.GroovyObject; public class A { public static void main(String[] args) { B b = new B(); if (b instanceof GroovyObject) { System.out.println("b is a groovyobject"); b.yeah(); ...
  • 澄清(可能会回答你的一些问题):我认为你的意思是pty(而不是ptty)是伪tty /伪终端。 tty(/ dev / ttyx) - 代表电传打字机 - 是原始终端(用于输出的行式打印机和用于输入的键盘!)。 终端基本上只是一个使用文本输入和输出的用户界面设备。 pty(/ dev / pty / n)是一个伪终端 - 它是一个软件实现,对于附加程序看起来像终端,但不是直接与“真实”终端通信,而是将输入和输出传输到另一个程序。 它是telnet / SSH甚至GNOME终端的终点。 例如,当您进入远程计算 ...
  • 你真的在你的BB上安装了libstdc ++ 6,ia32-libs吗? 它看起来像x86 lib。 看看Buildroot 。 它已经提供了BB目标,因此您可以非常快速地获得基本的rootfs。 然后只需添加所需的包即可完成。 使用像BR这样的发行版的主要好处是,你在rootfs中都需要依赖,你在microSD卡上刻录。 BR还提供Eclipse插件 。 I thought abi used was arm-linux-gnueabi but when i got the details of abi v ...
  • 我搜索了头文件,看到了他们的定义。 我在项目头文件中添加了他们的定义并完成了编译 I searched through the header files and saw their definitions. I added their definition in my project header files and the compilation completed
  • 一种方法是这样,如下所示。 我希望这些照片能够自我解释。 显示的模型是子系统A,采样时间为1s,原子系统是子系统B,采样时间为10s。 (请在另一个标签中打开图片以查看全尺寸型号) 这会产生以下信号,我相信这就是你所追求的。 One way to do this would be like this shown below. I hope the pictures are self-explaining. The model which is shown is subsystem A, with a sam ...
  • 最后,我做了以下工作: 我已将库源文件复制到我的目标平台(Altera De_nano_SoC ARM)并在那里编译库(Angstrom Linux,编译器arm-angstrom-linux-gnueabi)。 这需要在库文件夹中设置配置文件,并运行make和make install命令。 编译完成后,我将输出文件(头文件* .h和静态库文件* .a或共享库文件* .so - 取决于编译配置 )复制到我的主机(Windows 7)。 然后我将这些文件添加到我的Eclipse DS-5项目中。 Eclips ...
  • 可能,您获得的错误是由于单独的头文件定义,最重要的是x86架构的不同共享库文件和PowerPC体系结构的不同头文件。 您可以使用“-I”标志更改头文件定义,使用PowerPC体系结构的共享库文件路径更改头文件定义,可以使用-L选项进行更改。 但是这些所有更改都可能在Makefile中实现,所以你只需要改变不同标志中的位置,比如LDFLAG,CFLAGS等。 Probably, the error you are getting is due to the separate header file defin ...
  • 您可以查看Linux上的交叉编译wxWidgets应用程序 (Code :: Blocks wiki)和Linux下的交叉编译 (wxWiki)。 在Brent W. Woodruff C ++ wxWidgets简介中还有一个关于交叉编译Windows应用程序的部分。 You could have a look at Cross Compiling wxWidgets Applications on Linux (Code::Blocks wiki) and Cross-Compiling Under L ...
  • 并非所有库都有特定的步骤列表。 你必须以不同的方式设置PoDoFo,你只需要坐下来做它。 在最方便的方面(即使用库),该过程可能涉及为库创建Xcode项目并将其设置为构建为框架。 这对于iOS来说相当简单,因为您只能静态链接到平台上的第三方库。 因此,它主要只是建立一个项目来构建框架,添加相关文件和编译器/链接器标志,以及在必要时设置框架对框架的可见性。 对于其他库,您可以更改CFLAGS / CPPFLAGS / CXXFLAGS / LDFLAGS并从命令行构建静态库。 这不太方便,但最终会产生大致相同 ...
  • 在Trusty你可以apt-get xcb ,或者你想要开发人员的东西libx11-xcb-dev 。 看这里: https://packages.ubuntu.com/trusty/libx11-xcb-dev 您可以在那里使用搜索功能来解决这些问题。 In Trusty you can apt-get xcb, or if you want the developer stuff libx11-xcb-dev . See here: https://packages.ubuntu.com/trusty/ ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。