I have a question: how can I save a ID to a variable in VisualBasicScript. I know how to write in a ID but not how to read it. Please help me. Thanks Jonas
vendredi 1 mai 2020
Minimal Approach for building any website
The web technologies are a big jungle of great technologies. Is it true, that i could at least in theory build any possible website with this minimal approach using the following technologies:
- HTML for structure
- CSS for the layout
- Backend language (e.g. PHP or Python, etc.)
- Database or files for persisting data
Is it true that could completely go without Javascript rendering my website completely server side though probably inefficient or without any web framework like Express or Django to build any possible website?
Is there anything a could take away from that list above?
How to send an manual HTTP/2 request with socket in python?
Can you please tell me how to send an HTTP/2 request with socket in python as HTTP/2 doesn't use clear text and binary. I know there are modules such as requests and urllib but I want to do it in the socket way. (Can we just convert the text request into binary format and send it??)
Fixing a code to function how i need it to
Hello All
I am building a website and need some friendly advice. Trying to embed html code into my wix site.
i can do all that just fine. i need help with my code. Everything is in place; i have an input field, submit button and a field where the information input will be stored until the user of the profile where it was uploded delets it. i Need help linking all these elements together.
i can type but when i hit submit; the text doesnt go into the above field.
https://www.thewildshutterbug.com/profile/705c68ed-07e4-4618-a81d-6475649e128f/TheWildShutterbug
Above is a link, and at the bottom of the page is the embedded html.
Thanks!
Connect with scientists and wildilfe photographers from around the world, start a research project together or just hang out to learn about the animals that have been researched.
Dont forget to stop by our Animals A-z page to enter into the monthly photo contest to be featured on a prime web page for life. You name and Thewildshutterbug profile will be linked to all photos you get published!
Maybe you just want a print? Visit the Prints page and contact us. We are the first of our kind. We take requests and will get you custom picture you have always wanted for the right price.
A macro that copies web content
I am currently working on a macro that would open links to pages from column A (pages in column A could be, for example, 10 from a1 to a10) then select everything and copy to Excel, e.g. to the Page Sheet, every generation. Here's my initial macro:
Sub www()
Dim mmnt!
Dim strUrl$
Dim ie As Object
strUrl = "http:"
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.navigate strUrl
While (ie.Busy Or ie.readyState <> 4): DoEvents: Wend
mmnt = Timer: While Timer - mmnt < 2: DoEvents: Wend
ie.ExecWB 17, 0
ie.ExecWB 12, 2
Range("A1").Select
ActiveSheet.PasteSpecial Format:="HTML", link:=False, NoHTMLFormatting:=True
ie.Quit
Set ie = Nothing
End Sub
Unfortunately, the macro does not work on some internal pages. The problem occurs after Internet Explorer has been successfully launched and the page loads immediately receives the error message:
Run-time error - 2147467259 (80004005)
While (ie.Busy Or ie.READYSTATE <> 4): DoEvents: Wend
I have a question how to deal with it? How to improve the macro?
how to get json data accroding the 'id' in php
I want to ask how to get the json array data that I have created and display it according to the id chosen when clicking on the instructor's photo.
I have an instructor page that contains a list of instructor data, and an instructor's detail page which is a detailed description of the instructor that is clicked from the instructor's page.
I already have json data, but I can't call the data according to id, which looks like all the data is listed. How do I display data according to the index?
The error looks like the image below.
this is my instructors.php code
<main>
<section id="instructors">
<div class="container">
<div class="row">
<div class="col col-3">
<a href="instructor-detail.php?id=1" class="card-leader">
<div class="image">
<img src="<?= $base_url ?>assets/img/packleaders/shiqeen.jpg" class="img-fluid">
</div>
<div class="content">
<div class="name">Shiqeen</div>
<div class="initial">S</div>
</div>
</a>
</div>
<div class="col col-3">
<a href="instructor-detail.php?id=2" class="card-leader">
<div class="image">
<img src="<?= $base_url ?>assets/img/packleaders/mandy.jpg" class="img-fluid">
</div>
<div class="content">
<div class="name">Mandy</div>
<div class="initial">M</div>
</div>
</a>
</div>
<div class="col col-3">
<a href="instructor-detail.php?id=3" class="card-leader">
<div class="image">
<img src="<?= $base_url ?>assets/img/packleaders/hannah.jpg" class="img-fluid">
</div>
<div class="content">
<div class="name">Hannah</div>
<div class="initial">H</div>
</div>
</a>
</div>
<div class="col col-3">
<a href="packleader.php" class="card-leader">
<div class="image">
<img src="<?= $base_url ?>assets/img/packleaders/bebe.jpg" class="img-fluid">
</div>
<div class="content">
<div class="name">Bebe</div>
<div class="initial">B</div>
</div>
</a>
</div>
<div class="col col-3">
<a href="instructor-detail.php?id=4" class="card-leader">
<div class="image">
<img src="<?= $base_url ?>assets/img/packleaders/charisse.jpg" class="img-fluid">
</div>
<div class="content">
<div class="name">Charisse</div>
<div class="initial">C</div>
</div>
</a>
</div>
<div class="col col-3">
<a href="instructor-detail.php?id=5" class="card-leader">
<div class="image">
<img src="<?= $base_url ?>assets/img/packleaders/sherie.jpg" class="img-fluid">
</div>
<div class="content">
<div class="name">Sherie</div>
<div class="initial">S</div>
</div>
</a>
</div>
</div>
</div>
</section>
</main>
this is my instructor-detail.php code
<main>
<?php
$id = $_GET['id'];
$data = file_get_contents("http://cru68.test/assets/js/data-instructor.json");
$data = json_decode($data, TRUE);
?>
<section id="packleader">
<div class="container-fluid custom-container">
<div class="row">
<?php foreach ($data as $d) { ?>
<div class="col-12 col-sm-12 col-md-12 col-lg-6 video">
<div class="main-video d-flex-justify-content-center">
<div class="content-video">
<img src="assets/img/packleaders/packleaders-video-sample.jpg" alt="" class="img-fluid">
</div>
</div>
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-6 ">
<div class="biography">
<legend class="title"><?= $d['name']; ?></legend>
<div class="text">
<?= $d['description']; ?>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
</section>
</main>
and this is my json file data-instructor.json code for example
[{
"id": "1",
"name": "Shiqeen",
"description": "<p>Shiqeen wasn’t always a sporty spice. She picked up sports at the age of 17, playing touch rugby for 6 years. After graduating with a diploma in Sports and Exercise Science, she went on to to become a flight attendant. While flying, Shiqeen would visit gyms and studios, trying out fitness programs all around the world which inspired her to take a personal training course.</p> <p>Shiqeen loves high intensity workouts as they challenge the mind and body. Naturally, she got hooked on spinning and boxing, leading her to become a pack leader at CRU. When in class, expect her to be your personal hypegirl, cheering and pushing you past your limits. Dance (twerk) it out on the bag with ‘Shakween’ to hip hop and R&B tunes. We promise you a great sweaty time! </p>",
"image": "shiqeen.jpg"
},
{
"id": "2",
"name": "Mandy",
"description": "<p>Music and Endorphins — that’s what got Mandy hooked on CRU (cycle and box) and motivated her to become a pack leader at both studios - expect block rockin’ beats in her classes that will push you further than you thought you could go.</p> <p>Outside the studio - Mandy is an avid hiker and has explored peaks in Europe, Asia, and North America. The air is better up there and there is a sense of peace you get from being able to disconnect from everything.</p> <p>And if that doesn't do it for you, go for her class so you can hang out with resident CruCycle pupper, Udon.</p>",
"image": "mandy.jpg"
},
{
"id": "3",
"name": "Hannah",
"description": "<p>Hannah's Indoor Cycling journey – from struggling to catch the beat on bike 35, to rallying her riders from the instructor bike – happened right here at CruCycle. Known for her love of old to new school hip hop, Hannah's class is full of speed and swag. Get ready to add that bounce, and throw some groove into your ride.</p> <p> When she isn't teaching, hannah spends her downtime moseying around museums, eating Acai at Juice Junkie, or chillin' at home with her cats.</p> ",
"image": "hannah.jpg"
},
{
"id": "4",
"name": "Charisse",
"description": "<p>Charisse found her way to CruCycle when she was trying to get back in shape after her first child. She loved it so much, the mom of two never left.</p> <p>Hailing from Hong Kong, she has found indoor cycling to be one of the constants in her life, no matter where she is. She truly believes in pursuing what she loves, and wastes no time waiting.</p> <p>When she's not in the studio, she's usually on the plane, searching for a new adventure with her kiddos. If you're looking for some infectious laughs and catchy tunes, come ride with our resident mama.</p>",
"image": "charisse.jpg"
},
{
"id": "5",
"name": "Sherie",
"description": "<p>Sherie lives by the motto: sweat once a day. From yoga to spinning, the sweat life has been part of her journey, and she’s always game to try new workouts.</p> <p> To Sherie, Indoor spinning is more than just a workout – this sweat drippin’, heart racin’, endorphin pumpin’ activity is the most responsible dance party alive. Sherie believes that being on the bike is her way of being 100% present in the moment as she keeps her focus on the beats, the reps, and the energy in the room.</p> <p>Expect slick moves, fast tracks, and a sweat you won’t regret when you show up for Sherie’s class!</p>",
"image": "charisse.jpg"
},
{
"id": "6",
"name": "Kenny",
"description": "<p>Having been on both ends of the scale, Kenny believes that we all stand at different starting lines in our fitness journey. Embarking on his own journey and achieving a personal goal of being a healthier version of himself, he stands by the importance of finding a comfortable pace and working your way up.</p> <p> Kenny challenges his riders to dig deep and find the best versions of themselves without compromise and comparison. From the latest and greatest to throwback pop hits, Kenny is all about serving infectious, unapologetic energy. Be sure to leave Kenny's classes feeling recharged physically and mentally.</p> ",
"image": "kenny.jpg"
},
{
"id": "7",
"name": "Matthew",
"description": "<p>Matthew first fell in love with the CRU culture in 2016 when he began as an avid rider, braving the front row almost daily when he wasn't playing video games. He dreamt of rocking the CruCycle stage himself, so he decided to audition as a Pack Leader and has never looked back!</p> <p>He brings on the extra fun in class and pushes you a little further on the bike. Proving that you can accomplish anything as long as you stay faithful to your vision, Matthew does so in style.</p> ",
"image": "matthew.jpg"
}
]
What is the right way to change language without redirection in HTML?
I am new to web development and I have given the task to change the language of a website without changing the pages. (For example, somesite.com/en/home for English, somesite.com/jp/home for Japanese, etc.,). I think I have come up with a way using React, but I am not so sure whether this approach to changing languages is natural, efficient or not. Below is my code in React.js,
import React from 'react'
import metadata from './metadata'
class Display extends React.Component
{
constructor()
{
super()
this.state = {l: metadata[0]}
this.handleLanguageChange = this.handleLanguageChange.bind(this)
}
handleLanguageChange()
{
let lang = event.target.value;
if(lang == 'ta')
this.setState({l: metadata[0]})
else if(lang == 'en')
this.setState({l: metadata[1]})
else if(lang == 'jp')
this.setState({l: metadata[2]})
else if(lang == 'zh')
this.setState({l: metadata[3]})
}
render()
{
return(
<div>
<select onChange={this.handleLanguageChange}>
<option value="ta">Tamil</option>
<option value="en">English</option>
<option value="jp">Japanese</option>
<option value="zh">Chinese</option>
</select>
<h1>{this.state.l.language}</h1>
<h2>{this.state.l.title}</h2>
<p>{this.state.l.content}</p>
</div>
)
}
}
export default Display
and, here is my metadata.
const data = [
{
language: 'தமிழ்',
title: 'அறிமுகம் ',
content: 'வேலை செய்கிறதா என பார்க்க'
},
{
language: 'English',
title: 'Introduction',
content: 'To check whether this is working or not'
},
{
language: '日本語',
title: '紹介',
content: '動くかどうか分かるのため'
},
{
language: '中文',
title: '介绍',
content: '知道这是否有效'
}
]
export default data
and, index.js as well.
import React from 'react';
import ReactDOM from 'react-dom'
import Display from './Display'
ReactDOM.render(<Display />, document.getElementById('root'));
When I tested it, it worked like a dream. But is this approach right? Could this pose any security threats?
Please guide me in the right direction.