小编dmo*_*moz的帖子

使用jQuery查找XML节点并将其放入现有HTML表中

我正在尝试从XML Feed中提取一些股票信息并将其写入我网站上的某些现有div.

更新:由于CORS,我现在正在使用php代理.见下面的代码.

更新2:好的,到达那里.我下面更新的jQuery是第一个stockPrice变量,但不是剩下的三个.为所有这些数据提取的数据都是数字,所以我不确定为什么只有一个会工作.

这是我的HTML:

<div class="sidenavwrap">

    <div class="sidenavhd"><p class="stocktitle">XXXX (Common Stock)</div>


    <div class="ctcol3"><p class="stocklft">Exchange</p></div>
    <div class="ctcol4"><p class="stocklft">NASDAQ (US Dollar)</p></div>    
    <div id="stock-divider"></div>  

    <div class="ctcol3"><p class="stocklft">Price</p></div>
    <div class="ctcol4"><p class="stocklft" id="stockPrice"></p></div>  
    <div id="stock-divider"></div>

    <div class="ctcol3"><p class="stocklft">Change (%)</p></div>
    <div class="ctcol4"><p class="stockpriceneg" id="changePercent"></p></div>  
    <div id="stock-divider"></div>

    <div class="ctcol3"><p class="stocklft">Volume</p></div>
    <div class="ctcol4"><p class="stocklft" id="stockVolume"></p></div> 
    <div id="stock-divider"></div>

    <p style="text-align: center;">Minimum 10 minute delay</p>


    <div id="stock-divider"></div>  

    <br><br><br>
<!-- end sidenavwrap --></div>
Run Code Online (Sandbox Code Playgroud)

这是我的proxy.php:

// Set return content type
header('Content-type: application/xml');

// Website url …
Run Code Online (Sandbox Code Playgroud)

html xml ajax jquery

8
推荐指数
1
解决办法
196
查看次数

SVG fill with use tag

I'm trying to change the color of an SVG displayed on different pages using <svg id="logo-svg"><use xlink:href="#kmc-logo"></use></svg>.

The methods I'm trying are here: https://tympanus.net/codrops/2015/07/16/styling-svg-use-content-css/.

This is the SVG symbol I'm pulling in (shortened to relevant pieces):

<svg xmlns="http://www.w3.org/2000/svg">
    <symbol id="kmc-logo" viewBox="0 0 151 151">
        <g id="logo">
            <g id="outer-circle">
                <path fill="none" stroke-linecap="round" stroke-linejoin="round" d="M11.51 ..."/>
            </g>
            <g id="ceramics">
                <path stroke="none" d="M39.47 ..."/>
            </g>
        </g>
    </symbol>
</svg>
Run Code Online (Sandbox Code Playgroud)

I have this style in my stylesheet:

#masthead > .content-width .site-branding .logo--white a …
Run Code Online (Sandbox Code Playgroud)

css svg shadow-dom

6
推荐指数
2
解决办法
178
查看次数

标签 统计

ajax ×1

css ×1

html ×1

jquery ×1

shadow-dom ×1

svg ×1

xml ×1